SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to update use set of Records
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mohan123
Constraint Violating Yak Guru

India
252 Posts

Posted - 11/16/2012 :  08:34:31  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
2869 Posts

Posted - 11/16/2012 :  09:43:33  Show Profile  Reply with Quote
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

India
252 Posts

Posted - 11/16/2012 :  09:45:21  Show Profile  Reply with Quote
THanks JimF it worked for me

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

jimf
Flowing Fount of Yak Knowledge

USA
2869 Posts

Posted - 11/16/2012 :  10:21:25  Show Profile  Reply with Quote
You're Welcome.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000