Execute SQL Task

  • Hi,

    SELECT MAX(CmtID) AS CmtID

    FROM dbo.CADCmt...

    i declared this query in Execute SQL Task...

    i want to use that CmtID....how can i get that from Execute SQL Task..

    Thanks,
    Charmer

  • set a resultset type in the properties and then define the varaible in the resulset tab of editor.

  • thank you , and

    i want to use that variable in a script component to assign to a local variable...how can i do that?

    Thanks,
    Charmer

  • i'm not able to get the DTS.Varaibles...i don't know why..

    Thanks,
    Charmer

  • Whoaa! This is far more complicated than it needs to be. All you need to do is user parameters in your Execute SQL task - something like this:

    SELECT ? = MAX(CmtID) AS CmtID

    FROM dbo.CADCmt...

    Then map the parameter to a variable, remembering to set it as an output parameter, and you're there. No getting data out of Object type variables, and no scripting.

    There's loads of stuff out there on how to use parameters in the Execute SQL task. Have a read of some of it, and post back if there's anything you don't understand.

    John

  • sorry, i thought you were asking how to use the varaible that you had populated in a .net script... I must have mis-read.

Viewing 7 posts - 1 through 6 (of 6 total)

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