Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找在 Microsoft SQL Server Management Studio R2 上提供以下操作的解决方案:
使用以下代码
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