Store console output

  • Hello!

    I have a bunch of procedures to execute as a transaction.

    I need to be able to rollback the whole process in case some raises an error, and store the entire console output in a file to be able to trace the error.

    I could use xp_cmdshell to call ISQL as a DOS command and store its output, but this way the engine will not catch what the procedure does as part of the transaction, nor I'll be able to handle errors in the main script where I call every procedure... so I'll never be able to rollback. Ouch!

    Hope I was clear enough

    Please help!

  • Me again!

    This is what I meaned, and will never rollback :

    CREATE TABLE T1(Cod int)

    BEGIN TRAN

    EXEC master..xp_cmdshell 'ISQL -q"INSERT INTO MAGALLANES_SYST.dbo.T1(Cod) VALUES(1)" -SWKSAXIPMI204\DEV -Unemo_replicator -Pnemo_replicator'

    ROLLBACK  TRAN

    SELECT * FROM MAGALLANES_SYST.dbo.T1

     

    ......any ideas on how to store the console output during a transaction that may rollback?THANKS

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

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