Need help with some stored procedure

后端 未结 3 611
遇见更好的自我
遇见更好的自我 2021-01-28 09:21

The stored procedure:

ALTER PROC [Admin].[sp_Ques]    
(
 @QuesID bigint
 )
AS
BEGIN
 IF @QuesID = 0
  SET @QuesID =NULL
SELECT     FQ.QuesID, FQ.Ques,QuesAns 
F         


        
3条回答
  •  太阳男子
    2021-01-28 10:08

    The scope of FQ is limited to the first select statement.

    Your options include:

    1. Passing AdminLanguageID as a parameter as you have suggested
    2. Retrieving AdminLanguageID in a prior statement (select @AdminLanguageID = AdminLanguageID from...)
    3. Joining Admin.Language with Admin.Ques
    4. Using a subquery (select ... from Admin.Language where AdminLanguageID in (select AdminLanguageID from Admin.Ques where ...)

提交回复
热议问题