存储过程的问题?
存储过程中,有这样的语句
DECLARE @fid INT,@baseSort INT
SET @fid=(SELECT FID FROM [@PROGRAMMODULE] WHERE ID=@id)
SET @baseSort=(SELECT SORT FROM [@PROGRAMMODULE] WHERE ID=@id)
PRINT @fid
PRINT @baseSort
调用存储过程,打印不出值
但是
如果在查询分析器中,赋上@id值,就可以打印出值来
是怎么回事啊?
------解决方案--------------------SELECT @fid=FID FROM [@PROGRAMMODULE] WHERE ID=@id
------解决方案--------------------DECLARE @fid INT,@baseSort INT
SELECT @fid=FID FROM [@PROGRAMMODULE] WHERE ID=@id)
SELECT @baseSort=SORT FROM [@PROGRAMMODULE] WHERE ID=@id)
PRINT @fid
PRINT @baseSort
------解决方案--------------------居然只慢了十多秒~
DECLARE @fid INT,@baseSort INT
SELECT @fid=FID FROM [@PROGRAMMODULE] WHERE ID=@id
SELECT @baseSort=SORT FROM [@PROGRAMMODULE] WHERE ID=@id
PRINT @fid
PRINT @baseSort