IF NOT EXISTS (
		SELECT *
		FROM SYS.COLUMNS
		WHERE NAME = 'CD_TP_LANC' AND OBJECT_ID = OBJECT_ID('CG_FND_VERBA_EST_NF_ENT')
		)
BEGIN
	ALTER TABLE [dbo].[CG_FND_VERBA_EST_NF_ENT_PG_DEB] DROP CONSTRAINT [FK_CG_FND_VERBA_EST_NF_ENT_PG_DEB_CG_FND_VERBA_EST_NF_ENT]
	
	ALTER TABLE [dbo].[CG_FND_VERBA_EST_NF_ENT] DROP CONSTRAINT [PK_CG_FND_VERBA_EST_NF_ENT]

	ALTER TABLE [dbo].[CG_FND_VERBA_EST_NF_ENT] ADD CD_TP_LANC INT NOT NULL DEFAULT 1; 

	ALTER TABLE [dbo].[CG_FND_VERBA_EST_NF_ENT] ADD  CONSTRAINT [PK_CG_FND_VERBA_EST_NF_ENT] PRIMARY KEY CLUSTERED 
	(
		[CD_EMP] ASC,
		[CD_FND_VERBA] ASC,
		[CD_FILIAL] ASC,
		[CD_NF] ASC,
		[CD_TP_LANC] ASC 
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

END