CREATE TABLE [dbo].[usr_users_products]
(
[usrp_user_code] [dbo].[ais_code_medium] NOT NULL,
[usrp_product_code] [dbo].[ais_code_short] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[usr_users_products] ADD
CONSTRAINT [FK_usr_users_products_usr_users] FOREIGN KEY ([usrp_user_code]) REFERENCES [dbo].[usr_users] ([usr_user_code]) ON DELETE CASCADE ON UPDATE CASCADE

ALTER TABLE [dbo].[usr_users_products] ADD
CONSTRAINT [FK_usr_users_products_pr_products] FOREIGN KEY ([usrp_product_code]) REFERENCES [dbo].[pr_products] ([prd_product_code]) ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[usr_users_products] ADD CONSTRAINT [PK_usr_users_products] PRIMARY KEY CLUSTERED  ([usrp_user_code], [usrp_product_code]) ON [PRIMARY]
GO
