You are here: Re: Output result of query to existing file « MsSQL Server « IT news, forums, messages
Re: Output result of query to existing file

Posted by Erland Sommarskog on 05/09/07 22:17

(mamin@o2.pl) writes:
> I need to output result of my query to txt file. So I'm using -o
> parameter, for example:
>
> osql.exe -s (local) -d database1 -U sa -P sa -i 'c:\\queryFile.sql' -o
> 'c:\\output.txt'
>
> But it clears existing output.txt file first and then outputs the
> result, while I need to append the result of my query without clearing
> existing file content. Is it possible ?

Use >>, the standard append operator in the command-line environment.


--
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

 

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

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