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

how to export data with column headers in sql server 2008 with bcp command?

$
0
0

Hi all,

I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i am trying to import data with bcp command data has been copied but column names are not came.

I am using the below query:-

EXEC master..xp_cmdshell
'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'

Thanks,

SAAD.



Viewing all articles
Browse latest Browse all 23857

Trending Articles



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