可能重複一個用戶定義的標量函數:
Cast integer and concatenate to varchar in TSQL呼叫內的執行語句
我已經創建了兩個標量函數,每個返回uniqueidentifer
類型。我需要在執行語句中調用這些過程,但我似乎有語法錯誤。
Exec spModifyProductPropertyValue
@PAVID,
fnGetPropertyIDbyLabel(@Label7, @USPID, 0, 1),
@ProductID,
@Value7,
fnGetPINID(@7PIN),
0,
@counter out
我注意到那是什麼,當我單獨調用的函數,然後通過使用來自theprevious調用的輸出上面的號召,像這樣
Declare
@PropertyID as uniqueidentifier = null
Select @PropertyID = fnGetPropertyIDbyLabel(@Label7, @USPID, 0, 1)
Exec spModifyProductPropertyValue
@PAVID,
@PropertyID,
@ProductID,
@Value7,
fnGetPINID(@7PIN),
0,
@counter out
編譯器不會抱怨太多。這種方法的問題是我最終創建了很多這些臨時變量(差不多50),這是我想盡量避免的。我希望得到這個正確的任何幫助,請。
閱讀此:http://stackoverflow.com/questions/5967035/using-function-as-a-parameter-when-executing-a-stored-procedure。這是不可能的。 – prashanth