Курсовая работа: Информационная система военного округа
[Kol_vo_tehniki] Integer NOT NULL,
[Nomer_podrazdelenia] Char(10) NOT NULL,
Constraint [pk_Tehnika] Primary Key ([Tip_tehniki],[Kol_vo_tehniki],[Nomer_podrazdelenia])
)
go
Create table [Podrazdelenie]
(
[Nomer_podrazdelenia] Char(10) NOT NULL,
Constraint [pk_Podrazdelenie] Primary Key ([Nomer_podrazdelenia]))
go
Create table [Voorugenie]
(
[Tip_voorug] Char(10) NOT NULL,
[Kol_vo_voorug] Integer NOT NULL,
[Nomer_podrazdelenia] Char(10) NOT NULL,
Constraint [pk_Voorugenie] Primary Key ([Tip_voorug],[Kol_vo_voorug],[Nomer_podrazdelenia]))
go
Set quoted_identifier on
go
/* Update trigger "tu_Chast" for table "Chast" */
Create trigger [tu_Chast]
on [Chast] for update as
begin
declare @numrows int
select @numrows = @@rowcount
if @numrows = 0
return
/* Restrict child "Rota" when parent "Chast" updated */
if update([Nomer_podrazdelenia]) or