I want to rename the column from a table. I have tried:
EXEC sp_rename
alter table
alter table change
Also I do not want to add one more column and assign the data of old column to new and drop old column.
How can I do it ?
I want to rename the column from a table. I have tried:
EXEC sp_rename
alter table
alter table change
Also I do not want to add one more column and assign the data of old column to new and drop old column.
How can I do it ?
You can use sp_rename as follows :
EXEC sp_RENAME 'table_name.old_name', 'NEWNAME', 'COLUMN'
Use the Command
EXEC sp_RENAME 'Table_Name.CololdName', 'ColNewName' , 'COLUMN'
it is working perfectly for me
Its a old version of mssql so does not support above solutions but when i tried like this it works
EXEC sys.sp_rename 'fg.TABLE NAME.OLD_COLUMN_NAME','NEW_COLUMN_NAME','COLUMN';
anyway thanks for your efforts