if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ProductsImagesXTab]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
	CREATE TABLE [dbo].[ProductsImagesXTab](
		[ProductNumber] int NOT NULL,
		[ImageName] VARCHAR(255) NOT NULL
	
	CONSTRAINT [PK_ProductsImagesXTab_1] PRIMARY KEY CLUSTERED 
	(
		[ProductNumber], [ImageName] ASC
	)
)

	ALTER TABLE [dbo].[ProductsImagesXTab]  WITH NOCHECK ADD  CONSTRAINT [FK_ProductsImages_Products] FOREIGN KEY([ProductNumber])
	REFERENCES [dbo].[Products] ([ProductNumber])

	ALTER TABLE [dbo].[ProductsImagesXTab] CHECK CONSTRAINT [FK_ProductsImages_Products]

END


