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
 Transact-SQL (2000)
 Append using BCP

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2007-11-08 : 17:48:20
Is it possible to append data to the same file using BCP.Basically whenever the BCP is initiated it should append to the same csv file.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-08 : 17:49:56
No as bcp overwrites the file if it exists.

So to append, you can use the type DOS command:
type SmallFile.csv > BigFile.csv

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2007-11-08 : 18:17:32
This should work.Great idea.Thanks a lot
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-08 : 18:20:20
Oops, that should say type SmallFile.csv >> BigFile.csv since in this example BigFile.csv should already exist. You can also use wild cards: type *.* > BigFile.csv or type *.* >> BigFile.csv.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -