You are here: Re: Output to text-file « MsSQL Server « IT news, forums, messages
Re: Output to text-file

Posted by Roy Harvey (SQL Server MVP) on 01/13/08 08:58

On Sun, 13 Jan 2008 07:46:39 GMT, "Kaitsu" <Kaitsu@luukku.com> wrote:

>How can I get data from table to text-file by SQL-commands, for example
>SELECT * FROM Table. Result to text-file Table.txt.

This must be executed at a command prompt, not as a SQL query.

bcp.exe "select * from master..sysdatabases" queryout
sysdatabases.txt -c -T -t\t -r\n

There are many other parameters to consider, in particular -S to
specify the server, and -f to specify a format file. Read about it in
Books On Line.

Roy Harvey
Beacon Falls, CT

 

Navigation:

[Reply to this 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

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