How to Pass a value from the table to the varaible?

  • Hi Friends,

    I have a variable which has to receive the value from a column of a table .

    my Query is like " Select JurisID from the Table " Table will always be having a single record in it....

    i use a conditional split to get only those records based on the value...

    how to get the value from the table to be assigned to the variable ?

    Thanks,
    Charmer

  • Charmer (1/30/2012)


    Hi Friends,

    I have a variable which has to receive the value from a column of a table .

    my Query is like " Select JurisID from the Table " Table will always be having a single record in it....

    i use a conditional split to get only those records based on the value...

    how to get the value from the table to be assigned to the variable ?

    This may help you.

    DECLARE @JurisID int

    SET @JurisID = (Select JurisID from the Table)

    --Or

    Select @JurisID=JurisID from the Table

  • How to: Map Result Sets to Variables in an Execute SQL Task

    (Google is a wonderful thing)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Thank you Guys...I got it

    Thanks,
    Charmer

Viewing 4 posts - 1 through 3 (of 3 total)

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