IF NOT OBJECT_ID('PDV_CUPOM_NAO_FISCAL_EST_RPS_IT_idx') IS NULL	
    BEGIN
	   ALTER TABLE PDV_CUPOM_NAO_FISCAL_EST_RPS_IT DROP  CONSTRAINT PDV_CUPOM_NAO_FISCAL_EST_RPS_IT_idx 
	END
go
IF EXISTS (SELECT * 
		  FROM  
			 INFORMATION_SCHEMA.COLUMNS 
		  WHERE 
			 TABLE_NAME='PDV_CUPOM_NAO_FISCAL_EST_RPS_IT'
			 AND COLUMN_NAME='CD_CTR_IT'
			 AND IS_NULLABLE='NO')
BEGIN
    ALTER TABLE [dbo].[PDV_CUPOM_NAO_FISCAL_EST_RPS_IT] ADD  CONSTRAINT [PDV_CUPOM_NAO_FISCAL_EST_RPS_IT_idx] PRIMARY KEY CLUSTERED 
(
	[CD_CTR] ASC,
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[CD_CX] ASC,
	[CD_CTR_IT] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
END