Stored procedure output messages

  • Does anyone know of an SQL Server 2000 equivalent of the Oracle SPOOL command, i.e. SPOOL C:\TEMP\MyFile.txt which can be placed at the top of any sequence of SQL commands and directs system messages to the nominated file ?

  • This was removed by the editor as SPAM

  • There's several ways to do this... here's one if you have SA privs... there are other methods if this one doesn't suit ya... let us know...

    DECLARE @Cmd VARCHAR(8000)

    SET @Cmd = '@Echo ' + somechardata + ' >> ' + somefilename

    EXEC Master.dbo.xp_CmdShell @Cmd

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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