create proc test(@id int,@count int output)
as
set @count=(select count(*) from table)
select * from table where id=@id
这样子的话cmd.parameters["@count"].value为null
如果去除select * from table where id=@id output值就正确了
为什么不能同时使用呢?
...全文
1137打赏收藏
select * from table where id=@id和set @count=(select count(*) from table)不能同时执行
create proc test(@id int,@count int output) as set @count=(select count(*) from table) select * from table where id=@id 这样子的话cmd.parameters["@count"].value为null 如果去除select * from table where id=@id output值就正确了 为什么不能同时使用呢?