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)
 using BCP command

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-22 : 07:39:40
anand.nyam writes "hi,

When exporting data to a ascii file, bcp overwrites the already existing file.
can we append data to the existing file using BCP command to export data?
please reply.

Thanks,
anand"

nr
SQLTeam MVY

12543 Posts

Posted - 2005-11-22 : 07:54:37
This was asked yesterday.

You can create a new file and append that.
master..xp_cmdshell 'bcp ..... file1'
master..xp_cmdshell 'bcp ..... file2'
master..xp_cmdshell 'type file1 >> file2'
master..xp_cmdshell 'del file1'

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -