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.
| Author |
Topic |
|
EugeneLim11
Posting Yak Master
167 Posts |
Posted - 2008-03-14 : 08:57:26
|
| I have a table named Employee with the following fieldsEmployeeIDEmployeeNameEmployeeDesignation ....The column EmployeeDesignation is empty. (i.e. null values for all rows). and another table named EmployeeDesignation EmployeeIDDesignation Now I want to import all the data in EmployeeDesignation.Designation table to Employee.EmployeeDesignation Table where the EmployeeDesignation.EmployeeID = Employee.EmployeeID.How do I do that ?I tried selecting the designation into the table and I got an error saying "Employee table already exist."any help is very much appreciated. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-03-14 : 09:12:02
|
use UPDATE statementUPDATE eSET EmployeeDesignation = d.DesignationFROM Employee e INNER JOIN EmployeeDesignation d ON e.EmployeeID = d.EmployeeIDWHERE e.EmployeeDesignation IS NULL KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-03-14 : 09:14:08
|
| Are you trying to update the EmployeeDesignation field in the Employee table with infornation in the Designation field of the EmployeeDesignation table?JIm |
 |
|
|
EugeneLim11
Posting Yak Master
167 Posts |
Posted - 2008-03-14 : 21:38:30
|
| Jim yes |
 |
|
|
|
|
|