日期:2014-05-18  浏览次数:20426 次

么么茶的SQL問題.
DECLARE @output_a numeric(9,0) 
DECLARE @cmd nvarchar(200) 
SET @cmd= 'SELECT TOP 1 @a=mbrefid FROM reply ORDER BY leavewordtime ' 
EXEC SP_EXECUTESQL @cmd,N'@a numeric(9,0) OUTPUT',@a=@output_a OUTPUT
select @output_a as TestField
===============================================================
這樣試試.
帖子刪除掉了?

------解决方案--------------------
把这句改一下。 
EXEC SP_EXECUTESQL @cmd,N '@a numeric(9,0) OUTPUT ',@a=@output_a OUTPUT 

改为:

EXEC SP_EXECUTESQL @cmd,N '@a numeric(9,0) OUTPUT ',@output_a OUTPUT