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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Update between two tables

Status
Not open for further replies.

dr486

Programmer
Jan 9, 2002
105
0
0
AU
I currently have a table(t1) with two fields(f1, f2) that are populated with data

I have another table(t2) with two fields(f1, f2) where f1 is the only field populated with data

t1.f1 and t2.f1 have a one to one relationship.

I want to transfer the data from t1.f2 to t2.f2 where t1.f1 and t2.f1 are equal.

I tried using UPDATE but I have so much data, it takes to long.

Any suggestions would be appreciated

dr

 
I think this works:
Code:
SELECT [f2]
INTO [t1]
FROM [t2]
WHERE [t1].[f1] = [t2].[f1]
 
Thanks...I found this method on another post

UPDATE t1
SET t1.f2 = t2.f2
FROM t2
WHERE t1.f1 = t2.f1

A cursor was much to slow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top