Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Create text files in stored Procedure in SQL

$
0
0

Hello

I have select SQL statement in my Stored procedure. Now, I want to load data from sql to text file.

Can anyone suggest me the ways to do it? I know one SQL to load data from sql table to text file

i.e.

EXEC

master..xp_cmdshell 'bcp "Execute sp_Test " queryout "\\testserver\Files\testfile.txt" -c -S[yourserver/instancename] -T'

Is there any other option than this? Thanks

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>