views:

36

answers:

2

I'd like my app to run sql files and receive the results output as if the sql was run from SQL Management Studio with results to text. i.e. nicely formatted recordsets, printed messages, rows affected, errors, running multiple batches separated by GO statements, etc. Any suggestions how to do this without building it from scratch on top of a normal SQL connection?

I'm using C# .NET

+1  A: 

You don't say what language your application is written in, but if you're using .Net, you might get some help from the source code for QueryExPlus, a lightweight OSS alternative to SSMS.

Ed Harper
Thanks - that is useful!
Rory
A: 

Probably the easiest is to use GetXml() method of dataset and then apply XSLT transformation to produce the desired result.

IMHO