dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Mar 19, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Write SQL Results to a Text file

You can write results of a SELECT query into a text file in the following way:

master..xp_cmdshell 'osql -S SERVERNAME -U USERNAME -P PASSWORD -Q "SELECT * FROM TABLE" -d DATABASENAME -w "1000" -oc:\TextFile.txt'
Hannes du Preez
 
Thanks for your registration, follow us on our social networks to keep up-to-date