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)
 bcp to export data

Author  Topic 

anand.nyam
Starting Member

1 Post

Posted - 2005-11-21 : 09:45:28
can we append the data to existing file using BCP to export data. plz help.

thx.

nr
SQLTeam MVY

12543 Posts

Posted - 2005-11-21 : 10:28:31
No.
But 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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-22 : 01:07:01
quote:
Originally posted by nr

No.
But 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.


Thanks Nigel
Previously I thought this is not possible until we use FileSystem Object and copy the data from one File to other
But you have given the correct method

Madhivanan

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

- Advertisement -