Rename column in SQL Server

后端 未结 3 1290
Happy的楠姐
Happy的楠姐 2021-02-04 23:51

I tried the following code. Although I don\'t get any errors, it did not do it.

SELECT * FROM Categories EXEC sp_rename \'Active\', CategoriesActive
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 00:44

    You don't need to use that select in front, and the syntax should be like:

    EXEC sp_rename 
        @objname = 'Categories.Active', 
        @newname = 'CategoriesActive', 
        @objtype = 'Type_of_your_column'
    

提交回复
热议问题