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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 need help writing trigger...

Author  Topic 

thiruna
Starting Member

41 Posts

Posted - 2001-10-12 : 07:13:06
friends,
i have come up with one more question to clarify.....

i have got 3 tables machines, beverages and machine_beverages...

1. machine table has got machine_id, machine_name etc....

2. beverage table has got beverage_id, beverage_name

3. machine_beverage table has got machine_id, beverage_id, bev_key, gram_settings etc....

Now i have done the following programming for the data entry in 3 tables....

a. A data entry page for beverage table using ASP and stored procedure(SQL)

b. A data entry page for machines tables. This page receives the machine details and beverage settings for that machine and save it in corresponding tables.

if there are 5 beverages, it adds 5 entries in machine_beverage table when adding new machine to the machines tables.

In future, if new beverage gets added to beverage table, i want the SQL server to add beverage gram settings and beverage key (default to 0) in machine_beverage table for all the machines present in that.

I know this could be done using Trigger statement for the beverage table after every new insert.

could u please tell me how this trigger could be written


many thanks in advance
thiruna@vsnl.com

   

- Advertisement -