469,568 Members | 1,455 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

Select Records and Insert into Text File?

Greetings,

A novice needs some advice:

I am able to bulk insert data from a text file into a table. Is it
possible to run a query and insert the results into a text file on the
local or network hard drive?

Thanks For Reading,
Aaron

Sep 14 '07 #1
2 12810
One option is to use DTS , check this tutorial which gives you an overview
of the basic concept
http://www.sqldts.com/299.aspx
--

Jack Vamvas
___________________________________
Need an IT job? http://www.ITjobfeed.com


<ju*********@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
Greetings,

A novice needs some advice:

I am able to bulk insert data from a text file into a table. Is it
possible to run a query and insert the results into a text file on the
local or network hard drive?

Thanks For Reading,
Aaron

Sep 14 '07 #2
(ju*********@gmail.com) writes:
A novice needs some advice:

I am able to bulk insert data from a text file into a table. Is it
possible to run a query and insert the results into a text file on the
local or network hard drive?
There is no BULK EXPORT that is the inversion of BULK INSERT. You can
spawn the BCP command from xp_cmdshell, but xp_cmdshell is disabled on
SQL 2005 by default, and your DBA may not want to enable it.

Keep in mind that SQL Server is a server application, and it mainly
works with data in the database, and talk with clients over the network.
Things like reading files is mainly a duty for client programs to do.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Sep 14 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Mike R | last post: by
2 posts views Thread by Chris | last post: by
5 posts views Thread by Chris Cowles | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.