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 |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-03-23 : 03:01:16
|
| Dear Experts,I've two tables.......tab1 and tab2in tab1, columns are a,bin tab2, columns are c,dnow, datatypes are all same(varchar)now my problem is, if the data in column a and column d is same, the data in column c should be there in column b.that means, the data should be automatically updated in column b if the columns a and d are equal.please help me in this regard |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-03-23 : 03:26:10
|
| [code]Update t1set b = cFrom Tab1 t1 join Tab2 t2on t1.a = t2.d[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-03-23 : 04:25:14
|
| Thank you HarshaVinod |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-03-23 : 04:56:20
|
| and one more thing harsha, can you please tell me the trigger to fire whenever an insertion or updation takes place on these two tables.?thank you very muchVinod |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-03-23 : 04:58:35
|
| 1. My name is not Harsha, it's Harsh2. Write an Insert/Update trigger on those tableHarsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-23 : 05:06:51
|
quote: Originally posted by sunsanvin and one more thing harsha, can you please tell me the trigger to fire whenever an insertion or updation takes place on these two tables.?thank you very muchVinod
You can refer to this article for more infohttp://www.sqlteam.com/item.asp?ItemID=3850 KH |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-03-23 : 05:12:19
|
| sorry harshand thank you for the responce KHVinod |
 |
|
|
|
|
|
|
|