日期:2014-05-18 浏览次数:20442 次
create procedure selectUserInfo @UserName varchar(20), @PassWord varchar(20) as select isnull(count(*),0) as Total from UserInfo where UUserName=@UserName and UPassWord=@PassWord exec selectUserInfo @UserName='admin',@PassWord='1'
------解决方案--------------------
create procedure selectUserInfo @UserName varchar(20), @PassWord varchar(20), @Result int output as select count(*) from UserInfo where UUserName=@UserName and UPassWord=@PassWord -------------------- declare @a int set @a=0 exec selectUserInfo @UserName='admin',@PassWord='1',@a output select @a
------解决方案--------------------
--你的本来就可以啊 select Totalcount = count(*) from dbo.UserInfo
------解决方案--------------------
count(*) 本来就可以显示0
但是这个没有列名 如果在别的地方用的话 最好给他定义个列名