输出参数在SQL Server 2005中给出不同的结果

时间:2013-01-16 20:40:21

标签: sql-server-2005

我存储了proc,其中我正在调用另一个存储过程。

 Declare @itemNumber varchar(20),@productID int
 EXEC usp_find_productID
    @itemNumber = '35677',
    @productID = @productID OUTPUT

此sp在变量@productID中返回productID,但也作为结果集表返回。 有人能告诉我为什么会这样吗?

1 个答案:

答案 0 :(得分:1)

我打赌你会在存储过程中找到一个甜甜圈,你会发现:

SELECT @ProductID

并且存储过程在两台服务器上实际上是不同的。

当然我们无法分辨,因为你没有发布重要的部分(实际的存储过程代码)。