SQL Agent job step output

  • I have a SQL step that I have checked off output to log file, but it doesn't output any of the print commands I have in the step. I just get:

    Job 'Copy data from Staging' : Step 1, 'check table counts and date field in Staging tables' : Began Executing 2011-11-21 07:00:00

    Msg 18054, Sev 16, State 1, Line 22 : Error 50010, severity 10, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage. [SQLSTATE 42000]

    Partial code

    DECLARE @cnt int

    DECLARE @name varchar(50)

    DECLARE @todaysdate datetime

    set @todaysdate = convert (varchar(10), getdate(), 101)

    SELECT @cnt = COUNT(*) FROM equipdata

    print 'equipdata count'

    print @cnt

  • Output to file does not work?

  • I need way more details than that to help you.

  • I'm attaching a screenshot of what I have selected and filled in.

    So, basically, I need to log to a table in addition to log to a file to get all the details?

  • I've always checked all 3 fields.

    It gives me both the .txt document and a way to do a select to do more complexe filtering.

    I'm not 100% sure of the "best" way to do this. Sinec this logs 1 mb of data / month, I didn't bother with more research.

  • This morning, the job actually did output completely to the file. That job was scripted from an SQL 2005 system. Maybe because I went into the step and hit ok, that "activated" it?

  • No idea, glad it's working now ;-).

Viewing 8 posts - 1 through 7 (of 7 total)

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