Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle sqlplus SPOOL command in SQLSERVER?

Status
Not open for further replies.

7280

MIS
Apr 29, 2003
331
IT
Hi,
I want to run a script against a sqlserver database and
I want to redirect the output to a file.
How can I do that?

I run this script called exec_sql.cmd

isql -S servername -U sa -d database -i query.sql -o query.log

My query.sql has:
SELECT * FROM table WHERE cola IN (1,3,5,7,9,10,13...)
DELETE FROM table WHERE cola IN (1,3,5,7,9,10,13...)
SELECT * FROM table WHERE cola IN (1,3,5,7,9,10,13...)

Does this sql work? Unfortunately I don't have a test
database on which I can run the query.
I know that after the statement I don't have to put ;
Please help, thanks.

Tarek
 
Is it possible that I can't run something like the
SPOOL command before the statement??
How can I format the output??
Can I say the separator of the fields should be | ??
Where can I find documentation about these commands?
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top