[thelist] asp.net - exporting sql results with query/comments

Ken Schaefer Ken at adOpenStatic.com
Fri Sep 22 22:40:44 CDT 2006

I don't know what version of SQL you are using, but each version has a
command line tool (e.g. osql.exe). It would be relatively simply to use a
batchfile to call osql.exe to perform this type of repetitive operation...

Unless you need the user to supply parameters, in which case you probably
want to go down the path of developing an interface.



: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of cj
: Sent: Saturday, 23 September 2006 6:51 AM
: To: thelist at lists.evolt.org
: Subject: [thelist] asp.net - exporting sql results with query/comments
: what i'm trying to do is allow our support staff to speed up their
: query running.  currently they have a folder of txt and sql files that
: they need to run on a certain database (which is different for
: different support staff).  right now they open one of these txt/sql
: files, open sql studio, copy the query from the txt/sql file, paste it
: into sql studio, run the query, export the results, open the results,
: and paste the query into the results file.  rinse and repeat for every
: txt/sql file in the folder.
: i started with a demo from code project [1] and have gotten most of
: the functionality i need done, but i'm stuck on how to export the
: query and the query comments to the cvs file along with the results.
: having the query and query comments in the exported file is a biggy,
: but all i can do with the demo code is export results only.
: would anyone be able to guide me in the right direction to tweak the
: demo from code project to allow the query and comments to be exported
: along with the results?  i'll be up front and admit i'm not that great
: at c# or sql, so if there's a better way to do what i need that i
: wasn't able to find, i'm all ears and would appreciate knowing what it
: is.  i'm not opposed to starting over if it means i can get the query
: and comments exported.
: [1] http://www.codeproject.com/aspnet/ExportClassLibrary.asp

More information about the thelist mailing list