怎么会有这种要求?
你知不知道这个表有哪些字段?如果知道,可以:
if not exists (select * from tablename where a<>1)
print 'a'if not exists (select * from tablename where b<>1)
print 'b'...
你知不知道这个表有哪些字段?如果知道,可以:
if not exists (select * from tablename where a<>1)
print 'a'if not exists (select * from tablename where b<>1)
print 'b'...
select * from syscolumns c
where c.id=object_id(@tablename) and c.name = '1'