SQL Server Agent Jobs Log custom messages in Job History
问题 Is it possible to log custom messages from your SQL Server Agent job in the job history messages? If not what's the best way to go about doing such a thing? 回答1: For T-SQL job steps, you can use the print statement. For CmdExec steps, use Console.Writeline in your executable. If there is a lot of output, then by default SQL Agent will not keep all of, and will only keep a certain number of characters. To have it keep all output for a step, you go to the step properties, Advanced, and check