Reply to Re: Select Records and Insert into Text File?

Your name:

Reply:


Posted by Erland Sommarskog on 09/14/07 21:36

(junkmail115@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, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация