Grab value from a table into a variable

  • I have a TempFile table that holds the fileId and EntId from separate tables.

    ex

    ID FileID EntID

    1 3 4

    2 4 5

    Here ID is identity(1,1)

    I want to grab this EntID for the corresponding FileId in SSIS through a variable . I want to pass this value from the variable in to other tables.

    I am inserting into the TempFile table using the sp given below

    CREATE PROCEDURE [dbo].[usp_GEtAllIDS]

    (

    @CMD_File_ID BIGINT

    )

    AS

    BEGIN

    INSERT INTO dbo.GetIds (CMD_File_ID,Contract_Entity_ID)

    SELECT CF.File_ID ,

    CE.Entity_ID

    FROM dbo.Staging_Entities CSE

    INNER JOIN dbo.Files CF

    ON CF.File_ID = CSE.File_ID

    INNER JOIN dbo.Contract_Entities CE

    ON CE.Contract_Entity_Tax_ID = CSE.Entity_TIN

    END

    How do I get the EntID for each FileID ?

    Please help

  • Please do not post the same questions under multiple forum sections.

    Please do not reply to this post.

    Instead, see the following item:

    http://www.sqlservercentral.com/Forums/Topic999796-148-1.aspx



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

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

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