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 |
|
Antinsh
Starting Member
16 Posts |
Posted - 2008-03-14 : 05:03:37
|
| I have to DBs. One is the original and the other is for testing. They both have similar data structure. Wanted to know if there is a way to update tables contents in one db with data that is in the other one. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-14 : 05:11:34
|
| Do you want the table in second database to contain exactly same data as first one?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Antinsh
Starting Member
16 Posts |
Posted - 2008-03-14 : 05:30:34
|
| No want to create an update that would update one particular field in orginial database table and not for all rowsBasicly:UPDATE myTable SET imageField (field in Original)=imageFiled(field in db where are the right data)WHERE ID=1234 |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-14 : 05:38:17
|
| [code]UPDATE T1SET T1.FIELD1 = T2.FIELD1FROM DB1.DBO.TABLE1 T1 JOIN DB2.DBO.TABLE1 T2ON T1.ID = T2.IDWHERE T2.ID = 1234[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Antinsh
Starting Member
16 Posts |
Posted - 2008-03-14 : 08:23:56
|
| Thanks |
 |
|
|
|
|
|