PRINT statements in SQL Jobs

  • Very simple question here. I needed to write a SQL script to update values in a table. I've written the script and tested it in a test database. I put lots of PRINT statements throughout the code, so that I would know what it was doing as I tested it in SSMS. It worked fine on the test server.

    Now I've created a SQL Job on the production server, using this script. Is it OK if I leave the PRINT statements in the code, or should I comment them out?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • I would leave Print gives you nice log out put :).

    I use that in one of my SQL 2000 job where it is detailed Store Proc doing the work; and I make a call to another proc that prints out DATE - Log Message.

    And result is if i have logging turned on in the job it all gets printed to log; makes for a easy log to follow.

    Thanks.

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

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

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