在SQL数据库中,判断指定表中是否存在指定列,如果不存在,则创建:

if (NOT exists ( select * from dbo.syscolumns where name = 'g_id_gglx' and id in
(select id from dbo.sysobjects where id = object_id(N'[dbo].[crm_custom_zk]') and OBJECTPROPERTY(id, N'IsUserTable') = 1))
)
Alter table crm_custom_zk add g_id_gglx varchar(50) not null DEFAULT  ''"

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2021-11-18
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-12-15
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案