473,473 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Output result of query to existing file

Hi,
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 ?

May 9 '07 #1
1 6198
(ma***@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, 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
May 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin Foster | last post by:
Hi. I want to do something really simple. I want to be able to write a custom SQL query in a textbox on a webpage, submit it and then output to the webpage in the format of MySQL output i.e....
2
by: vishal | last post by:
hi vishal here. can anyone tell me that how to buffer output and then send the output to client at a time. what is my problem is that i have a php file which runs query on database and takes...
2
by: Bob | last post by:
Everybody, I've been doing a lot of on-line research and cannot find any reference to the exact problem I'm having. Let me preface this question with the fact that I'm coming from an Oracle...
5
by: Glenn | last post by:
Hi! Server info - Win2K3 Server +SP1 with 1 GB Memory and 1.5 GB Virtual Memory SQL Server 2000 Enterprise Edition + SP3 running on this. Required result - Create a SQL Script that will...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
6
by: t_rectenwald | last post by:
Hello, I attempting to execute an Oracle query, and write the results to a file in CSV format. To do so, I've done the following: import cx_Oracle db = cx_Oracle.connect('user/pass@DBSID')...
1
by: maryanncanor | last post by:
Hi I would like to know if there is a macro that can export the data from a query to an output textfile that has NO QUOTES. If I run the concatenated query Expr1: & & & & & & & ...
1
by: afelotreyu | last post by:
Hello, I currently have an application in perl that starts a text based torrent client, once I give the necessary parameters to the torrent.exe it will start printing out the following information...
11
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition:...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.