I have one store procedure in my database, it makes many things and print results when i run it on sqlserver management studio (ssms), for example:
exporting table abc…
exporting table def…
deleting table temp…
My program has to run the store procedure and show the output anywhere (maybe creating a log file), such as ssms does (it shows output in the messages tab). I have to show exactly the same ssms shows. How can I do this?? sqlcmd, ado.net?? I see this question
but, answer is not clear… Help!!
If you want to capture warning and information messages, you will want to create a SqlInfoMessageEventHandler delegate to handle the SqlConnection.InfoMessage event. See references below for details.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.infomessage.aspx
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlinfomessageeventhandler.aspx