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 |
|
DURGESH
Posting Yak Master
105 Posts |
Posted - 2008-06-10 : 00:03:19
|
| HI ALL,CAN ANYBODY HELP ME TO SOLVE THE ISSUEI WANNA UPDATE A RECORD OF ONE TABLE WITH VALUES THAT ARE PRESENT IN A COLUMN OF ANOTHER TABLEORCAN I DO THE SAME USING INSERT QUERYTHANKS IN ADVANCE |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-10 : 00:22:17
|
| UPDATE dSET d.Field1=s.FieldnFROM destinationtable dINNER JOIN SourceTable sON d.LinkingCol=s.LinkingColwhere linking columns are columns by which two tables are related |
 |
|
|
dreddski
Starting Member
9 Posts |
Posted - 2008-06-10 : 12:14:49
|
| hi there Visakh, I just want to ride on with Durgesh question..Can you further clarify your code by this example:?for example: I have two tables "MASTER" and "SLAVE"..both have columns "Tester" and "Handler" in it...So If I made a transaction on the "MASTER" Table to update the data on "Tester" and "Handler" colums, how can the values of the "tester" and "handler" Data of the "SLAVE" Table be updated using your code? Thanks... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-10 : 12:18:03
|
| UPDATE dSET d.Tester=s.Tester,d.Handler=s.HandlerFROM SLAVE dINNER JOIN MASTER sON d.LinkingCol=s.LinkingColLinking columns are columns in MASTER & SLAVE by which two tables are related |
 |
|
|
dreddski
Starting Member
9 Posts |
Posted - 2008-06-11 : 12:12:17
|
| hi visakh.. thanks for the reply and I got the idea... but somehow it wont work...For the first line Update d, ' is this really the syntax or the d is a variable? sorry newbie here..thanks! |
 |
|
|
dreddski
Starting Member
9 Posts |
Posted - 2008-06-11 : 12:12:18
|
| hi visakh.. thanks for the reply and I got the idea... but somehow it wont work...For the first line Update d, ' is this really the syntax or the d is a variable? sorry newbie here..thanks! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-11 : 12:21:44
|
quote: Originally posted by dreddski hi visakh.. thanks for the reply and I got the idea... but somehow it wont work...For the first line Update d, ' is this really the syntax or the d is a variable? sorry newbie here..thanks!
d is the alias for table SLAVE UPDATE d suggests SLAVE is to be updated. |
 |
|
|
|
|
|