您的位置:首页 > 其它

Judge whether a column exists in a table

2006-06-08 12:28 267 查看
if not exists( select 1 from dbo.syscolumns s
where name ='yourColumn'
and id = object_id(N'YourTable'))
begin
alter table YourTable add yourColumn ColumnType
end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐