if exists(select * from test.dbo.test1 where a='1') begin print('exists ') end else begin print('no exists ') end go