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 |
|
boreddy
Posting Yak Master
172 Posts |
Posted - 2008-12-23 : 02:11:27
|
| in my databse i have 3 related tablesi want to update two table columns by joining the three tablesis it possible thank you |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-12-23 : 03:38:18
|
| yesuse trigger try like this or post ur tables structuresUpdate t set col1= value,col2 = value2from table tinner join table1 on t.id = t1.idinner join table2 on t.id = t2.id |
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2008-12-23 : 03:45:47
|
| User triggers, It will be more useful to u..CREATE TRIGGER Trig_StudentDetailsONtable1For Update ASBEGIN --Update Statement For table1 Update tbl_StudentDetails set StdName='jammmu' where StdId = 9END--Update Statement for Table2Update tbl_StudentDetails1set StdName='Jaggu' where StdId= 11I Struggle For Excellence |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-25 : 01:52:30
|
| or what you can do is to create a view which combines the tables and update the tables through them. But there should not be any complex statements in view like aggregations,.. for them to become updatable. Else you need trigger. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-25 : 01:53:51
|
| see this toohttp://weblogs.sqlteam.com/brettk/archive/2008/04/03/60560.aspx |
 |
|
|
|
|
|