我提取從探查下面的代碼段(從聲明由於失敗「附近有語法錯誤,」):在一個存儲過程調用使用的結果集的查詢作爲參數的
exec sp_executesql @statement = N'CREATE TABLE --other stuff...
DECLARE @student_id_ticket INT
EXEC @student_id_ticket = systecsys_get_next_ticket (select top 1 table_id from systecsys_table where name like ''%Student_List%''), ''n'', 1
--INSERT statement using this value and other stuff
我知道它因爲子查詢而失敗,因爲當我使用硬編碼值時,它會起作用。因此,可能存在異步處理或一般語法錯誤的問題。 T-SQL 2000.
請提出補救措施。謝謝!
你嘗試過擺脫括號,或添加圍繞整個systecsys_get_next_ticket參數列表另一套? – samjudson
我試過後者。現在會嘗試另一個。 thx – ppecher
沒有人工作:( – ppecher