Add a new column into the table
ALTER TABLE Table_Name
ADD column_name datatype;
Modify a table- drop column name:
ALTER TABLE table_name
DROP COLUMN column_name;
How to rename a column in SQL Server:
EXEC sp_RENAME 'TestTabl1.OldColumnName', 'NewColumnName', 'COLUMN'
Query should get successfully get executed. and also if the table is already populated
you would get a warning message like:
Caution: Changing any part of an object name could break scripts and
stored procedures.
No comments:
Post a Comment