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 |
|
nitin05.sharma
Starting Member
20 Posts |
Posted - 2011-07-04 : 10:02:18
|
| hii am workin on sql server 2005 i want to get multiple column of a row from a table and set into other table on the basis of corresponding IDi used thisupdate YM_StoreInfo(select old.Address1 old_Add1,old.Address2 old_Add2,new.Address1 new_add1,new.Address2 new_add2from YM_StoreInfo old LEFT JOINYM_UpdateStoreInfo newON old.ID = new.StoreInfoID where old.ID=1)SET old_Add1=new_add1,old_Add2=new_add2 but this give an errorjust lke incorrect syntax near ')'just lke incorrect syntax near '('please help me |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-07-04 : 10:10:27
|
You're not in Kansas (MS Access) any longer!UPDATE siSET si.Address1 = usi.Address1, si.Address2 = usi.Address2FROM YM_StoreInfo AS siLEFT JOIN YM_UpdateStoreInfo AS usi ON usi.StoreInfoID = si.IDWHERE si.ID = 1 N 56°04'39.26"E 12°55'05.63" |
 |
|
|
nitin05.sharma
Starting Member
20 Posts |
Posted - 2011-07-04 : 10:15:03
|
| hithanks swepesoi tried this but its not workingit gives "The multi-part identifier "old.Address1" could not be bound." such kind of error |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-07-04 : 10:28:13
|
No, it's not.Copy and paste my suggestion by the letter and try again. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2011-07-04 : 11:42:15
|
| Or post the new code you tried.Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
nitin05.sharma
Starting Member
20 Posts |
Posted - 2011-07-05 : 02:25:23
|
| HI thanks swepeso now its working finethanks alot |
 |
|
|
|
|
|