Stored Procedure print to log file.

  • I want to log the print statements from a stored procedure to the SQL Server Agent job history. If I can't use print can I use raiserror with settings that wont stop the SSS package.

  • Kelvin Phayre (5/1/2009)


    I want to log the print statements from a stored procedure to the SQL Server Agent job history. If I can't use print can I use raiserror with settings that wont stop the SSS package.

    From where do you want to log the print statements? From a script code?

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • I want to write to a log file or the SQL Agent history from within my stored procedure. If I had a simple SSIS package that executes an SQL task that called a stored procedure. I want the code within the stored procedure to echo its progress somewhere.

    I have written a c++ .exe that took two params. The first is a reference and the second a txt sting. It then opened a .txt file and wrote the string. This replaced the print commands within the stored procedure.

  • Kelvin Phayre (5/1/2009)


    I want to write to a log file or the SQL Agent history from within my stored procedure. If I had a simple SSIS package that executes an SQL task that called a stored procedure. I want the code within the stored procedure to echo its progress somewhere.

    I have written a c++ .exe that took two params. The first is a reference and the second a txt sting. It then opened a .txt file and wrote the string. This replaced the print commands within the stored procedure.

    Check this post. It is somewhat related. There is a stored procedure called sp_dts_addlogentry created by "SSIS Log Provider for SQL Server". Call it in your stored procedure to do the logging.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

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

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