CREATE TABLE [dbo].[pr_products_introducers]
(
[prdint_product_code] [dbo].[ais_code_short] NOT NULL,
[prdint_branch_id] [int] NOT NULL,
[prdint_introducer_id] [int] NOT NULL,
[prdint_retro_code] [dbo].[ais_code_short] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[pr_products_introducers] ADD 
CONSTRAINT [PK_pr_products_introducers] PRIMARY KEY CLUSTERED  ([prdint_product_code], [prdint_branch_id], [prdint_introducer_id]) ON [PRIMARY]
ALTER TABLE [dbo].[pr_products_introducers] ADD
CONSTRAINT [FK_pr_products_introducers_pr_products_branches] FOREIGN KEY ([prdint_product_code], [prdint_branch_id]) REFERENCES [dbo].[pr_products_branches] ([prdb_product_code], [prdb_branch_id])
GO

ALTER TABLE [dbo].[pr_products_introducers] ADD CONSTRAINT [FK_pr_products_introducers_act_introducers] FOREIGN KEY ([prdint_introducer_id]) REFERENCES [dbo].[act_introducers] ([int_actor_id])
GO

ALTER TABLE [dbo].[pr_products_introducers] ADD CONSTRAINT [FK_pr_products_introducers_int_retrocessions] FOREIGN KEY ([prdint_retro_code]) REFERENCES [dbo].[int_retrocessions] ([iret_retro_code])
GO
