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)
 Merging Table

Author  Topic 

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2007-02-13 : 11:01:47
Hi all,

I have Two Tables Like

TA:
Cola(varchar), Colb (Datetime)
TB:
Cola(varchar), Colb (Varchar), Colc (Varchar)
The Table A Contains 2 Million Records and Table B Contains 10 MIllion Records. I just want to merge the Table a in to Table B

What is the way i going to merge the table
Can any one please help me

Thanks
Krishna

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-13 : 11:22:01
You're going to need to give us some DDL and some sample data and what you expect the final result to be



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-13 : 11:34:07
What about ColC value while merging?

Insert TB(cola, colb)
select ColA, ColB
from TA
Left Join TB on TA.ColA = TB.ColA and TA.ColB = TB.ColB
Where TB.ColA is NULL and TB.ColB is NULL


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2007-02-13 : 11:48:04
Thanks Harsh,I dont need to merge the Third column.
Can we do the same thru BCP.?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-13 : 13:40:14
quote:
Originally posted by CSK

Thanks Harsh,I dont need to merge the Third column.
Can we do the same thru BCP.?



bcp out? Yes

bcp in? No



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -