时间:2021-07-01 10:21:17 帮助过:41人阅读
IF EXISTS(SELECT 1 FROM SYSOBJECTS so,SYSCOLUMNS sc WHERE so.ID = sc.ID AND so.NAME=‘表名‘ AND sc.NAME=‘字段‘)
IF EXISTS(SELECT 1 FROM syscolumns WHERE id = object_id(‘表名‘) AND name = ‘字段‘)
IF COL_LENGTH(‘表名‘, ‘字段‘) IS NOT NULL PRINT N‘存在‘ ELSE PRINT N‘不存在‘
SQL Server2008R2学习记录
标签:obj blog 存在 pre server object cts else logs