lets say I have a SQL stored procedure that use print statements. In query
analyser the results of the print statements they would appear in the message
tab. How can I capture these messages in a Power shell script ?
Thanks
I was trying to show you a practical example using SMO, but cannot seem
to figure out how to run a stored procedure from it.
Normally, you're information will go directly to the console, but you
need to script that stored procedure to be run by a PowerShell script.
I can't explain it better than that right now.
What version of SQL? I think SMO is only supported with 2005, so that
might not even be an option.
Marco
--
Crito
To run the stored proc you need to use ADO.NET. You could return the
information as output parameters. I'll put an example on my blog
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk
--
Crito