判断表是否为空?

来源:互联网 发布:淘宝空间图片传不上去 编辑:程序博客网 时间:2024/03/29 18:51

 if  (select  count(*)  from  table)>0  

select  *  from  test  
if  @@rowcount  >0  

if  exists  (select  *  from  test)  

if  (select  top  1  id  from  test)  is  null  

原创粉丝点击