MSSQL: rename column doesn't work

igitur's profile image igitur posted 9 years ago in General Permalink
Currently, HeidiSQL attempts to rename a column on a table as such:
ALTER TABLE "dbo"."TableName"	ALTER COLUMN  "NewColumnName" BIT NOT NULL;


The correct syntax to rename a column in MSSQL is:
EXEC sp_RENAME 'TableName.OldColumnName' , 'NewColumnName', 'COLUMN'
.

Please login to leave a reply, or register at first.