Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Aug 3, 1999

SQL Redirection to a Text File

Question:
How do I redirect the output of a SQL query to a file?

Answer:
Use the isql command-line switches to redirect the output of a query to a file. Try this line, substituting your server name after the /S:

 
D:\>isql /q EXIT("SELECT * FROM pubs.dbo.authors") /SYourServerName /U"SA" /P"" > MYTEXT.TXT
The redirection symbol (>) moves it to the text file.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date