how to assign results from a sql task to a global variable in SQL Server 7?

  • hi,

    My requirement is to run two sqls, get the result, create a new file with some specific format and add these results to the file and upload it to a ftp.

    Whats in my mind is to assign the resultset to global variable and use that in activex script to create file and upload it. But, the problem is how to assign the results to global variables?

    I am using SQL Server 7 version.

    Thanks, Sat

  • Have a look at

    http://www.sqlservercentral.com/articles/DTS/dtsandglobalvariables/2266/

    There they assign values to global variables.

  • Thanks for the input, but the article is not talking about how to execute sql query/stored proc and read the resultsset. My requirement is to execute a sql, get the result set, process it, create a dat file and upload it to an ftp folder. please help...

  • I would create a small program outside of sql server that does this. (datasets in .NET?)

    You could also try to store the outputs in temporary tables.

    For text-files you might consider bcp.

  • Hi Jo,

    What i have to deal with is sql server 7. And, i have adopted the following approach and it seems to be working:

    1. Create a table in db (one time and first time)

    2. Truncate table

    3. load the results to table

    4. in activex script, read the results from table,

    5. create a csv file from results

    6. upload it to ftp

    And this is working...

    I tried to use table data type and found that it is not supported by 7 version. I am still working on to fine tune this design. Do you have any inputs/ideas for this design???

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

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