Parameter Information cannot be derived from SQL statements with sub-select queries

  • Trying to execute the SSIS package in BIDS-2005 and keep getting same error. While same package works in BIDS 2008 very well. I downgraded package from 2008 to 2005 also made it from scratch using BIDS-2005 but still same error.

    bypassprepare is TRUE also

    passing BatchID1 as ? in below querry. BatchID is column in dbo.my_table.

    trying to load row count from my_db.dbo.xyz to dbo.my_table

    UPDATE dbo.my_table SET SrcRecCnt = (select COUNT(*) from My_db.dbo.xyz)

    WHERE BatchID=?"

    failed with the following error: "Parameter Information cannot be derived from SQL statements with sub-select queries. Set parameter information before preparing command.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    If need to create expression can suugest expression for this query ?

    Any one has face this issue and can help me with solution would be great help

    Thanks

  • Yeah, you need to create an expression.

    Its fairly easy tho.

    Add a new parameter, call it something like 'strUpdateSQL'

    change it to a string.

    Make sure you Properties Pane is open (F4)

    Click on the parameter value. No go to Properties pane, Change the evaluateasexpression property to True.

    Click the Expression Elipses.

    and your expression will be something like:

    "UPDATE dbo.my_table SET SrcRecCnt = (select COUNT(*) from My_db.dbo.xyz)

    WHERE BatchID=" + (DT_STR, 10, 1252) @[User::BatchID]

    @[User::BatchID] is the Parameter you want to use for your batch ID.

  • HI Ray

    I was able to solve this task with your great help . i really really appereciate it .:-P:-P

    10000 hats of to you and your skills.

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

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