我正在寻找在Microsoft SQL Server Management Studio R2上提供以下操作的解决方案:
答案 0 :(得分:2)
使用以下代码
declare @n int
set @n = (select ISNULL(count(*),0) from table_name)
if(@n=0)
print 'not result'
else
select * from table_name
或
if(select count(*) from table_name)=0
print 'not result'
else
select * from table_name