1.查询某列是否存在某表里,不存在则添加此列

 

if not exists(select 1 from dbo.syscolumns where name='列名' and ID=object_id('表名'))
begin
alter table 表名 add 列名 列类型
end

 

相关文章:

  • 2021-12-21
  • 2021-09-21
  • 2021-08-30
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-01-15
  • 2021-10-23
  • 2022-01-06
相关资源
相似解决方案