reading a Global variable

  • Hi There

    I am currently writing a stored procedure that runs

    ------------------------------------------

    use master

    exec xp_cmdshell "DTSRun /S servername /U username /P password /N package name/A variable"

    ------------------------------------------

    I need the to read this variable so that I can run an oracle stored procedure using its contents.

    any ideas anyone?

  • It may be long way. However one alternative is as follows.

    Create a batch file (.bat) with following commands

    a) Run the DTSRUN with /A

    b) Print the contents of variable to console.

    In the stored procedure

    a) create a temporary table with one column

    #tmp_consoledata(data varchar(255))

    b) do a INSERT INTO EXECUTE xp_cmdshell batchfile.bat

    Now all the output from the batch file will be available in the temporary table.

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

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