标题: [求助]請問一下,下面這條語句錯從何來? [打印本页] 作者: HG 时间: 2002-10-8 22:04 标题: [求助]請問一下,下面這條語句錯從何來? /*
alter procedure usp_qry_deficiency (@my_year as smallint,@my_month as smallint,@wage_pay_deficiency as money output)
as
select @wage_pay_deficiency = ((select sum(wage_sum) from wage where wage_date_year =@my_year and wage_date_month = @my_month) -(select sum(wage_sum) from wage where wage_date_year = @my_year and wage_date_month = @my_month and wage_pay = 1))
*/
SQL服務通過沒問題,但
declare @my_def as money
exec usp_qry_deficiency @my_year = 2002,@my_month = 8,@my_def output
select @my_def
執行時出錯如下:
Server: Msg 119, Level 15, State 1, Line 14
Must pass parameter number 3 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'.
真不明,我以前都是這樣搞的,都沒出過錯,但今天真奇怪。請各位診斷一下,多謝!作者: HG 时间: 2002-10-8 22:09
CALL,原因很簡單
原來 exec usp_qry_deficiency @my_year = 2002,@my_month = 8,@my_def output
改為這樣的形式即可exec usp_qry_deficiency 2002, 8,@my_def output
今不知微軟搞什麼鬼的,偏偏在輸出參數上有些改變。不注意用戶的使用習慣。