if Exists(select 1 from abc where aid=100)
begin
--如果为空........
print '没有'
end
else
begin
--如果不为空.......
print '有返回结果'
end
解决方案 »
- 关连表创建问题
- 有关于数据库学习问题!
- 请各位老师帮我解决用excel数据导入SQL Server 2005出错的问题?
- 数据库读取Excel数据
- MSSQL服务突然不能启动,提示系统找不到指定路径,如何解决
- 程序无法连接自己设定ip的windows2003下的sql2000数据库
- 初学者问个问题
- MSSQL2005 存储过程调dll在sp_OAcreate创建实例时失败,而在MSSQL2000是要用的!请高人解答!
- 如何求得总分?
- 求一个SQL查询的写法
- 急!!在SQL Server中有没有把二进制数转化为16进制数的字符串的函数,或者通过脚本怎么处理?多谢,多谢!!
- sql 2k5是否会如同vs--->vs.net那样大变样咧????
begin
--如果为空........
print '没有
end
else
begin
--如果不为空.......
print '有返回结果'
end
--如果为空........
print '有返回结果'
else
--如果不为空.......
print '没有'
if Exists(select 1 from abc where aid=100)
--如果不为空.......
print '有返回结果'
else
--如果为空........
print '没有'
if @@rowcount=0
print '没有记录!'
else
print '有记录!'
set @n=(select 1 from .. where ..)
if @n is null
print 'null'
else
print 'not null'
if @@rowcount>0
print 'not null'
else
print 'null'