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

update 1

Status
Not open for further replies.

eshaan

Technical User
Feb 20, 2003
57
US
I am trying to update one filed from table1 to another field table2 with join condition about 50,000 records.
It is is giving error 0 records updated.

Urgent please.
 
Eshaan.

Without seeing what your code looks like, it is difficult to see what the problem is.

(e.g. what sort of join have you used.. inner, left or right?)

------------------------
Hit any User to continue
 
You possibly haven't got the correct SQL statement but again, without seeing it I do not know. If this is Urgent for you, perhaps you can be a little more forthcoming with your posts?

Ok - Here's a test I did.

Tables:
[From] (FromID, FromText)
[To] (ToID, FromID, FromText)

Query as follows:
UPDATE [From] INNER JOIN [To] ON From.FromID = To.FromID SET [To].FromText = From.FromText
WHERE (((To.FromID)=[From].[FromID]));

Results:
40 rows were updated.

------------------------
Hit any User to continue
 

Regarding your statement:
"UPDATE [From] INNER JOIN [To] ON From.FromID = To.FromID SET [To].FromText = From.FromText
WHERE (((To.FromID)=[From].[FromID]));"

It seems that it should rather read "Update [To] INNER JOIN [From] ON ..."

Your statement did work... I guess the driving force is the set statement.

Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top