IF EXISTS (SELECT * FROM SYS.TABLES WHERE NAME='RC_ADM_CARTAO_PARC_MINIMA_OLD')  
BEGIN
	EXEC SP_RENAME 'RC_ADM_CARTAO_PARC_MINIMA_OLD','RC_ADM_CARTAO_PARC_MINIMA'

IF  NOT EXISTS (SELECT * FROM sys.objects 
		WHERE object_id = OBJECT_ID(N'[dbo].[RC_ADM_CARTAO_PARC_MINIMA]') 
		AND type in (N'U')) 
 
BEGIN
	CREATE TABLE [dbo].[RC_ADM_CARTAO_PARC_MINIMA](
		[CD_EMP] [int] NOT NULL,
		[PARC] [int] NOT NULL,
		[VLR_MIN_PARC] [money] NOT NULL,
		[QTD_MAX_PARC] [int] NOT NULL,
		[STS_PARC] [int] NOT NULL,
		[DT_CAD] [datetime] NOT NULL,
		[CD_USU] [int] NULL,
		[CD_GRP_ECON] [int] NOT NULL,
	 CONSTRAINT [PK_RC_ADM_CARTAO_PARC_MINIMA_NOVA] PRIMARY KEY CLUSTERED 
	(
		[CD_EMP] ASC,
		[PARC] ASC,
		[CD_GRP_ECON] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY]

	END
END

