CREATE TABLE [dbo].[ris_cpl]
(
[rcpl_risk_situation_id] [int] NOT NULL,
[rcpl_rowver] [timestamp] NOT NULL,
[rcpl_class_id] [int] NULL,
[rcpl_zone_id] [int] NULL,
[rcpl_usage_id] [int] NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[ris_cpl] ADD
CONSTRAINT [FK_ris_cpl_grpusg_usages] FOREIGN KEY ([rcpl_usage_id]) REFERENCES [dbo].[grpusg_usages] ([usgu_usage_id])
ALTER TABLE [dbo].[ris_cpl] ADD
CONSTRAINT [FK_ris_cpl_grpzon_zones] FOREIGN KEY ([rcpl_zone_id]) REFERENCES [dbo].[grpzon_zones] ([zonz_zone_id])
ALTER TABLE [dbo].[ris_cpl] ADD
CONSTRAINT [FK_ris_cpl_grpcls_classes] FOREIGN KEY ([rcpl_class_id]) REFERENCES [dbo].[grpcls_classes] ([clsc_class_id])
ALTER TABLE [dbo].[ris_cpl] ADD 
CONSTRAINT [PK_ris_cpl] PRIMARY KEY CLUSTERED  ([rcpl_risk_situation_id]) ON [PRIMARY]
ALTER TABLE [dbo].[ris_cpl] ADD
CONSTRAINT [FK_ris_cpl_ris_risks_situations] FOREIGN KEY ([rcpl_risk_situation_id]) REFERENCES [dbo].[ris_risks_situations] ([riss_risk_situation_id])
GO
