/ Published in: SQL
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
EXEC sp_rename 'TableName.ColumnName', 'ColumnName_int', 'COLUMN'; GO ALTER TABLE 'TableName' ADD COLUMN ColumnName VARCHAR(10); GO UPDATE TABLE 'TableName' SET ColumnName = CAST(@ColumnName_int AS VARCHAR(10)); GO ALTER TABLE 'TableName' DROP COLUMN ColumnName; GO