如何在sql中更改列名 [英] How to change column name in sql

查看:64
本文介绍了如何在sql中更改列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i我试图将sql2008中的列名从StudentId更改为SID。

i我正在使用此查询:

  alter   table 学生
重命名 StudentId SID



使用此表未更改表列。 />
所以请任何人帮助我。

提前感谢



关于,

naresh

解决方案

可以使用

 SP_RENAME '  Student.StudentId''  SID''  COLUMN' 



如此处所述

SQL SERVER - 如何重命名列名或表名 [ ^ ]


exces sp_rename'Persons.city','c_name',column


更改列名不用于存储过程请帮助简单查询

hi all,

i am trying to change column name in sql2008 from StudentId to SID .
i am using this query :

alter table Student
rename column StudentId to SID


By using this not altered the table column .
so that please any one help to me.
thanks in advance

regarding ,
naresh

解决方案

The column can be renamed using

SP_RENAME 'Student.StudentId', 'SID ', 'COLUMN'


as explained here
SQL SERVER – How to Rename a Column Name or Table Name[^]


exces sp_rename 'Persons.city','c_name', column


change column name not use to store procedure please help simple query


这篇关于如何在sql中更改列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆