How to retrieve OUTPUT statement when calling stored proc through Powershell

Question:

I am running the following script in powershell, however I don’t seem to be able to retrieve any PRINT statements or error messages? How do I capture all outputs within the powershell session please?

Answer:

The way I’ve implemented Eventhandler is as follows:

Source:

How to retrieve OUTPUT statement when calling stored proc through Powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply