请教一条判断表中是否有返回值记录的SQL语句! if exsist(select X From Table where expression) pringt ""else print "" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if exists (select top 1 * from Table where ...) print 'dfadf'else print 'gdsgds' if (select count(0) from table where ...) > 0 print 'y'else print 'n'-- orif exists(select 1 from table where .....) print 'y'else print 'n' declare @icount intselect @icount=count(*)from tableif @icount>0beginprint 'y'endelsebegin print 'n'end if (select b.rowsfrom sysobjects a,sysindexes b where a.id=b.id and a.name='表名') is not null print 'y'else print 'n' if exists(select 1 from table where .....) print 'y'else print 'n' 关于一个IN的SQL语句优化 有没有办法select所有行内容合并为一个字符串? 求一SQL语句! 求;一个查询的sql语句 怎样查询,根据字段的特点 如何改写上面这个存储过程,使得,指定的登陆名存在,就返回它的编号,否则,返回0。 我运行存储过程,传入一个参数作为where字句中的条件子句,出错,马上揭帖 如何将sql server配置到网络上,使应用程序可以随时随地访问数据库? 什么是极次排列啊? SQL SERVER 2008数据库磁盘空间不足问题 如何将access中的数据导入sqlserver? 菜鸟问题:别人给我一个.mdf的文件。我怎么加入到SQL SERVER里
print 'dfadf'
else
print 'gdsgds'
print 'y'
else
print 'n'-- or
if exists(select 1 from table where .....)
print 'y'
else
print 'n'
select @icount=count(*)from table
if @icount>0
begin
print 'y'
end
else
begin
print 'n'
end
from sysobjects a,sysindexes b where a.id=b.id and a.name='表名') is not null print 'y'
else
print 'n'
print 'y'
else
print 'n'