IF OBJECT_ID('PG_CRED_ALT_AUDIT') IS NULL
begin
CREATE TABLE [dbo].[PG_CRED_ALT_AUDIT](
	[CD_CTR] [int] IDENTITY(1,1) NOT NULL,
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[NR_DP] [int] NOT NULL,
	[VLR_PRINCIPAL] [money] NULL,
	[VLR_DESC] [money] NULL,
	[VLR_DEV] [money] NULL,
	[VLR_NOVA_DEV] [money] NULL,
	[VLR_JUROS] [money] NULL,
	[VLR_TAXA] [money] NULL,
	[VLR_IMPOSTO] [money] NULL,
	[VLR_LIQUIDO] [money] NULL,
	[DT_VENCTO] [datetime] NULL,
	[CD_USU] [int] NOT NULL,
	[CD_BARRAS_BOLETA] [varchar](150) NULL,
	[CD_PG_CRED] [int] NULL,
	[CD_DP_LANC] [int] NULL,
 CONSTRAINT [PK_PG_CRED_ALT_AUDIT] PRIMARY KEY CLUSTERED 
(
	[CD_CTR] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]


ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_PRINCIPAL]  DEFAULT ((0)) FOR [VLR_PRINCIPAL]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_DESC]  DEFAULT ((0)) FOR [VLR_DESC]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_DEV]  DEFAULT ((0)) FOR [VLR_DEV]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_NOVA_DEV]  DEFAULT ((0)) FOR [VLR_NOVA_DEV]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_JUROS]  DEFAULT ((0)) FOR [VLR_JUROS]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_TAXA]  DEFAULT ((0)) FOR [VLR_TAXA]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_IMPOSTO]  DEFAULT ((0)) FOR [VLR_IMPOSTO]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_VLR_LIQUIDO]  DEFAULT ((0)) FOR [VLR_LIQUIDO]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_CD_BARRAS_BOLETA]  DEFAULT ('') FOR [CD_BARRAS_BOLETA]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_CD_PG_CRED]  DEFAULT ((0)) FOR [CD_PG_CRED]

ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] ADD  CONSTRAINT [DF_PG_CRED_ALT_AUDIT_CD_DP_LANC]  DEFAULT ((0)) FOR [CD_DP_LANC]
end