SQLServer triggers
Posted
by Evl-ntnt
on Stack Overflow
See other posts from Stack Overflow
or by Evl-ntnt
Published on 2010-04-08T11:08:55Z
Indexed on
2010/04/08
11:13 UTC
Read the original article
Hit count: 326
Please help me to write trigger that, adds new rows in table
I have 3 tables in my database. 1) Regions (id, name); id - primary 2) Technics (id, name); id - primary 3) Availability (id, region, technic, count); id - primary, region - foreign on Regions.id, Technik - foreign on technics.id
I want to add new row in Availability for each Technics row on adding row in Regions.
Somethink like:
procedure void OnAddNewRegion(int region) { foreach (Row r in Technic) { Availability.Rows.Add(new Row(id, region, r.Id, 0)); } }
But in SQL trigger. Same I want to do on the adding new Technics row
© Stack Overflow or respective owner