日期:2014-05-18 浏览次数:20580 次
if exists(select * from syscolumns where id=object_id('tableName') and name='columnName') print '存在' else print '不存在'
------解决方案--------------------
IF EXISTS(SELECT 1 FROM SYSCOLUMNS WHERE ID=OBJECT_ID('TB') AND NAME='FDAF') PRINT '存在'
------解决方案--------------------
if exists(select * from sys.syscolumns where id=object_id('表名') and name='字段名') print '在' else print '不'