Get output of SQL Procedure and assign it to a variable used in WHERE Clause

  • Get output of SQL Procedure and assign it to a variable used in WHERE Clause

    Later I want to use this variable in my code in the WHERE Clause

    Declare @ProjectNo nvarchar(10)

    --Now I want to assign it to output of a storedprocedure which returns only 1 value and use it in the below SELECT query.

    SELECT ID from TABLEA where Project in (@ProjectNo)

    How to do it. How to assign @ProjectNo to output of storedProcedure called 'GetProjNumber'

    Please help

  • Duplicate post. No replies to this thread please, replies to: http://www.sqlservercentral.com/Forums/Topic1554328-392-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply