IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_TRIB_CONF_GRP_NCM]')) 
	BEGIN 
		RETURN;
	END
ELSE
	BEGIN
		CREATE TABLE [dbo].[EST_TRIB_CONF_GRP_NCM](
			[CD_EMP] [int] NOT NULL,
			[CD_CTR] [int] NOT NULL,
			[NR_NCM] [varchar](50) NULL,
		 CONSTRAINT [IX_EST_TRIB_CONF_GRP_NCM] UNIQUE NONCLUSTERED 
		(
			[NR_NCM] ASC,
			[CD_CTR] ASC
		)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
		) ON [PRIMARY]



		SET ANSI_PADDING OFF
		

		ALTER TABLE [dbo].[EST_TRIB_CONF_GRP_NCM]  WITH CHECK ADD  CONSTRAINT [FK_EST_TRIB_CONF_GRP_NCM_EST_TRIB_CONF_GRP] FOREIGN KEY([CD_EMP], [CD_CTR])
		REFERENCES [dbo].[EST_TRIB_CONF_GRP] ([CD_EMP], [CD_CTR])
		

		ALTER TABLE [dbo].[EST_TRIB_CONF_GRP_NCM] CHECK CONSTRAINT [FK_EST_TRIB_CONF_GRP_NCM_EST_TRIB_CONF_GRP]
		
	END


