Hi All
I have written a sp and I would like to export he result set to a file.
Is there a bit of script I can add to do this for me?
Many Thanks
Rich
Code Snippet
exec master..xp_cmdshell 'bcp "select * from <mytable>" queryout c:\<myFile.txt> -S<Servername> -U<myUserId> -P<myPassword>'
replacing all the <...> fields with your values
|||Thankssql
No comments:
Post a Comment