Mapping SQL query output with global variable

  • I would like to map the output of a simple SQL query (executed by an SQL Query Execution Task in my DTS) with a global variable. The result of my query is a simple set of values from one column, and I would like to have these values in a list (to be used from a JScript or VBScript script). But I can't manage to define a "list" type for my global variable. The only type that might fit are "Pointer" or "HResult", but if I try to choose these, I get the following message : "Impossible to convert variable myVar of type BSTR to type Hresult" for example...

    Anybody has a clue ?

  • What is the "list" being created for?

  • Actually, I wanted to replace all occurences of a each string contained by this list in a database table, but in fact, I just figured out it was easyer to use a RecordSet within my VB script, since these strings are in a database table, and I don't need this intermediate list... But I would still be curious to know how one could store output parameters from a query into a kind of "Set", as a global variable in the DTS environnment...

    Thanks.

  • You'll need to output the results of the Execute SQL into a recordset global variable. Then you can use VBS to extract the data from ther recordset (which is what I think you did after reading your second post).

    If you do not specify to output to a recordset within the Execute SQL task, then you can only output a single variable to the global variable. At least this is what I have found in my experience with sets of data to global variables.

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

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