SQL Server Agent Jobs Log custom messages in Job History
sql-agent, sql-agent-job, sql-server, t-sql
Solution
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 the "Include step output in history" checkbox.
Problem
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?