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 |
|
Mredfer
Starting Member
4 Posts |
Posted - 2009-12-14 : 13:08:15
|
| Hi,I am very new to SQL and am trying to update some information in one database from information in a second database (see below) but cannot get it to "set" the information in database1(SOTEST) from the information in database2 (SOTRANSFER).USE SOTESTupdate Projectset PROJ_ANAL_ID_2=Use SOTRANSFER select analysis_code_2 from contract where contract_code='111507'where proj_code='111507'Thanks very much in advanceMikeI Always Need HEEEELP!! |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-12-14 : 13:14:50
|
=Use SOTRANSFER select analysis_code_2 from contract where contract_code='111507'select analysis_code_2 from SOTRANSFER.dbo.contract where contract_code='111507'or better yetUSE SOTESTupdate pset PROJ_ANAL_ID_2 = c.analysis_code_2FROM Project pJOIN SOTRANSFER..contract cOn c.contract_code = p.proj_codeWHERE p.proj_code = 111507 |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-12-14 : 13:19:49
|
| If both the DB's are on the same server. |
 |
|
|
Mredfer
Starting Member
4 Posts |
Posted - 2009-12-15 : 04:23:17
|
| Thanks very much,Will try that now.I Always Need HEEEELP!! |
 |
|
|
Mredfer
Starting Member
4 Posts |
Posted - 2009-12-15 : 05:54:04
|
| Thanks very much,It is now working, thanks very much.I Always Need HEEEELP!! |
 |
|
|
|
|
|