if exists (select * from syscolumns a ,sysobjects b where b.name='tKHXX' and a.id=b.id and a.name='KHH') begin select '有' end else begin select '没有' end
if exists (select * from syscolumns a ,sysobjects b where b.name='表' and a.id=b.id and a.name='列') begin select '有' end else begin select '没有' end
if exists(select 1 from syscolumns where name='列名' and id=object_id('表名')) print '村在' else print '不存在'
select '有'
end
else begin
select '没有'
end
select '有'
end
else begin
select '没有'
end
print '村在'
else
print '不存在'