Trying to rename a column today in an MSSQL database. I expected the standard ALTER TABLE x CHANGE oldColumn newColumn <type>
to work, but apparently that's a MySQL-only thing? Instead I did a quick Google search and came up with this nugget:
EXEC sp_rename
@objname = "pages.permalink",
@newname = "slug",
@objtype = "COLUMN";
Thanks to DustyReagan.com, or check out the full docs for sp_rename
in Transact-SQL.