title: How to update data in one table from corresponding data in another table in SQL Server 2005
body: <p>I have two tables in different databases on the same database server.</p>
  
  <p>Both the databases have the same structure, but different data. Database1 (Test1) is the latest, and database2 (Test2) is an old copy of the database.</p>
  
  <ul>
  <li>Test1 has a table called <code>Employee</code> with 3000 records</li>
  <li>Test2 has a table called <code>Employee</code> with  1000 records</li>
  </ul>
  
  <p>I need to update the table in Test1 from the same table in Test2 for a particular column called DeptID, because the values in the Employee table in the Test2 DB (the old one) have been updated. So I need to update the table in the new DB from the table in the old DB which has around 1000 rows.</p>
  
  <p>In other words, I need to update the <code>DeptID</code> column in the <code>Employee</code> table in the <code>Test1</code> DB with whatever values I have in the <code>DeptID</code> column in the <code>Employee</code> table in the <code>Test2</code> DB.  </p>
  
  <p>I know I can restore the DB itself, but that's not a solution. I need to update the values in the Test1 database from the Test2 database.</p>