Is there a way I can setup a scheduled task that will run a specific SQL query (basically a SELECT statement) and automatically export the results to a file (that could be a CSV or whatever human readable/parser friendly format)
Note: SQL Server 6.5 is not reachable via remote access. All must be done in an NT4 system by connecting locally.
You can create a batch file that runs bcp.exe with a column delimiter of comma. You can then use the SQL Executive (I believe that's what the SQL Agent is called in 6.5) to schedule it as a job.
you could also just schedule a regular NT4 job with the AT command running the batch file but the method Tara illustrates is probably easier to keep track of as it's more logically tied to sqlserver.
Charlie =============================================================== Msg 3903, Level 16, State 1, Line 1736 The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Bcp.exe does allow you to write custom queries if you specify the queryout option. For more complex queries, you'll need to create a view and then bcp out that view.