Heyo folks,
Just looked on Google and around on this site, and there's very little information.
Given a query which is "SELECT * FROM Table WHERE (various)"
, I'm putting in a BCP utility query like thus, called from C# (.net 3.5, but can be raised).
xp_cmdshell 'bcp "SELECT * FROM [DB].dbo.[table] " queryout "\\networkpath\bla\file.csv" -N -S localhost -T -E -m0'
However, when I run this query in SQL Management Studio, it helpfully keeps supplying me with "1000 rows were copied." messages. I want to get those messages in my C# application.
I've tried several C# methods, including SqlDependency, SqlConnection.InfoMessage, BeginExecuteNonQuery(), etc; hence the lack of C# code.
What would be the best method to do this?
Cheers