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
 General SQL Server Forums
 New to SQL Server Programming
 How to update use set of Records

Author  Topic 

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2012-11-16 : 08:34:31
I have users table in that lot of records in that one i need to update only FirstName,Lastname,MiddleName in that from another table

i have 600000 records in one table and 580000 records in another table.i have to update only 580000 records in users table??How to write query for this >???

P.V.P.MOhan

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2012-11-16 : 09:43:33
UPDATE tgt
SET FirstName =src.FirstName
,MiddleName = src.MiddleName
,lastname = src.lastName
FROM TargetTable tgt
INNER JOIN SourceTable src
ON <whatever the link is between the tables>

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2012-11-16 : 09:45:21
THanks JimF it worked for me

P.V.P.MOhan
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2012-11-16 : 10:21:25
You're Welcome.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -