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


advertisement
 

Tip: Write SQL Results to a Text File

See how to write the results of a query to a text file.


advertisement

WEBINAR:

On-Demand

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


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'

 

Visit the DevX Tip Bank

 





   
Comment and Contribute

 

 

 

 

 


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

 

 

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