Dear Lijie,
If you're using Query Analyzer;
Select Option>Tools> Click Results Tab and select "Results to File" in
"Default Result Target"
And in the "General" Tab you can set Where to put the Query result File and
what will be its properties.
If you're using "osql" or "isql" tool;
Osql -I InputScriptFileName -o QueryOutputFile
And you can give other parameters also like User, password, server name
etc..
The description of osql and isql is as follows.
The osql utility allows you to enter Transact-SQL statements, system
procedures, and script files. This utility uses ODBC to communicate with the
server.
The "isql" utility allows you to enter Transact-SQL statements, system
procedures, and script files; and uses DB-Library to communicate with
MicrosoftR SQL ServerT 2000.
The difference between these two tools is the communication library it uses.
If you need further help let me know.
Regards,
Thilina
-----Original Message-----
From: [Email Address Removed] [mailto:[Email Address Removed]
Sent: Tuesday, April 20, 2004 8:47 PM
To: LazyDBA.com Discussion
Subject: How to spool file in MS SQL?
Hi, Gurus:
I will appreciate if you can tell me how to spool a file in MS SQL when you
run a script.
Thanks
Lijie (Lee) Gu
Database Administrator
Alberta Blue Cross
Phone: (780) 498-5926
[Email Address Removed] NOTE: This communication, including any attached documentation,
is intended only for the person or entity to which it is addressed, and may
contain confidential, personal, and/or privileged information. Any
unauthorized disclosure, copying, or taking action on the contents is
strictly prohibited. If you have received this message in error, please
contact us immediately so we may correct our records. Please then delete
or destroy the original transmission and any subsequent reply. Thank you.
--------
Get today's cartoon: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page