0

When executing IF/THEN queries in SQL Server I am using a Print Statement to let the user/myself know what 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?

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.