存储过程返回值的问题?会的教教我啊,在线等,解决就散分
在存储过程中当select语句成功查询出一条记录时就返回1,否则返回0
Set Nocount on
if Exists(
select * from admin where userName=@username and userPass=@pwd
)
begin
set @rows=1
return
end
else
begin
set @rows=0
return
end
Set Nocount off
但是insert,update,delete语句像上面那样就会报错
Set Nocount on
if Exists(
delete from news where n_Id=@newsId
begin
set @rows=1
return
end
else
begin
set @rows=0
return
end
Set Nocount off
正确写法应该是怎样的?