Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Keeping Field Names when exporting with BCP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-30 : 07:19:40
Gilbert writes "Hi.

I�m a new SQL user, and I�m trying to export SQL tables to TXT tables with the BCP function. It works perfectly, but I can�t bring the field names to the TXT files. I don�t see any parameter that could do that for me. Could you give me a hint about how to do it?

The command I am using now is:

EXEC master..xp_cmdshell 'bcp "SELECT * FROM ema.dbo.RFMACUMALT" queryout "c:\tablas data mining\rfmACUMALT.txt" -S HP-ML350 -T -n -c'
go

Thanks"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-30 : 07:21:04

Refer this
http://weblogs.sqlteam.com/brettk/archive/2005/04/13/4395.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -