There is one more way as I wrote some days ago...
You can use Jet OLEDB driver with "sp_addlinkedserver" after this you can
use INSERT .. INTO statement to save queries into text files. See "OLE DB
Provider for Jet" in the BOL. ("Accessing and changing relational" data
section...)
[quoted text, click to view] "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:991EF098-D357-4B48-8D9E-FEE6622608B6@microsoft.com...
> Is it possible in T-SQL to directly send query results to a text file
without the use of command line utilities and command shell procedure calls?
>
> (The only reason I ask is because a friend of mine insists he once used
something like a 'SET OUTPUT <filename>' command with SELECT. I think he's
referring to a different db system. In any case I can't find anything like
it in SQL Server documentation.)