开发者

SQL Server PRINT and Messages export to a .txt file

When executing IF/THEN queries in SQL Server I am using a Print Statement to let the user/myself know w开发者_如何学运维hat has happened.

Also when I run a query SQL Server mentions how many rows have been affected.

After searching I have only come across MySQL functions that allow PRINT statements to be exported via SELECT into OUTFILE. Does SQL Server have a way to send the PRINT statements and or messages to a .txt file for logging?


If you run your script as a SQL Agent job, you can specify Output file on the Advanced settings of a step.

You don't have to use SQL Agent as a scheduler, you can run the job manually, or use sp_start_job.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜