Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP

Status
Not open for further replies.

hiren1437

Programmer
Dec 12, 2003
6
IN
Hi all,

I want to bcp out a table and bcp into another table with more no. of columns than the first table ? So is it possible to do so with the use of the row terminator option of bcp ,I m not able to do so .

It is urgent

TIA
Hiren
 
bcp out the table. Drop the table. Re-create with the correct number of columns, and bcp in the new data?

Greg.
 
thanks greg .
but that is not possible has the bcoz the table with greater no.columns cannot be dropped has it is alomost like a master table . ANd the task performed here is to transfer some data between two servers


 
Hi Hiren,

with bcp you can use format-files to convert data from one table/server to another. In the format file you can either drop cols or specify the new sequence. As a good information about the syntax I can recommend the book "Sybase SQL Server 11 Unleashed" (SAMS Publishing).

Rgds,
Balduri
 
Hiren,

This is way too late I'm sure, but I would create a table in tempdb with just the fields from the originating table. Then I would bcp the data in, and run an insert statement from that table into your table with the extra columns.

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top