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 |
|
u2envy1
Yak Posting Veteran
77 Posts |
Posted - 2008-03-14 : 08:19:19
|
| query on data in another table.I have two tables.Table 1EventID EventName01234 JackpotTable 2EventName AmountJackpot 123.00EmptyCanister 14.00I would like to query Table2 based on the events in the Table1. How do I do this ?Not using select * from Table2 where EventName = 'Jackpot' |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-03-14 : 08:28:51
|
use INNER JOINselect *from table1 t1 inner join table2 t2 on t1.EventID = t2.EventName KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
u2envy1
Yak Posting Veteran
77 Posts |
Posted - 2008-03-17 : 01:56:10
|
| Much appreciated.One more thing.....I created an insert trigger on Table2.If the EventName in Table2 = the EventName in Table1Then the insert trigger on Table2 must fire & insert on anotherdatabase that is a linked server.The linked server table is exactly the same as Table2 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-17 : 12:55:31
|
| Insert trigger will fire only when you perform insertion on Table2. Check for this condition on insertion of a record to Table2 and if matching then INSERT the record into linked server. |
 |
|
|
u2envy1
Yak Posting Veteran
77 Posts |
Posted - 2008-03-19 : 03:42:58
|
| How do I check the condition from Table1 ? |
 |
|
|
|
|
|