I have a temp table in sql server 2008 and I need to create a csv of txt file by tsql from that temp table.
What is the correct way for it?
Thanks.
I have a temp table in sql server 2008 and I need to create a csv of txt file by tsql from that temp table.
What is the correct way for it?
Thanks.
If you provide tempdb.. it can access temp tables
exec master..xp_cmdshell 'bcp " select * from tempdb..#tables" queryout c:\test.txt -c -T'