Monday, July 21, 2008

Export Stored Procedure results to text file

Use the BCP command.... You will need to have access to xp_cmdshell which is an advanced setting in sp_configure...
exec master..xp_cmdshell 'bcp "exec myDB..uMyProc" queryout c:\umytable.txt -T -c'

No comments: