if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FAT_ELPAG]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

/****** Object:  Table [dbo].[FAT_ELPAG]    Script Date: 30/11/2018 11:30:52 ******/

CREATE TABLE [dbo].[FAT_ELPAG](
	[ditta] [int] NOT NULL,
	[id] [bigint] NOT NULL,
	[idpag] [int] NOT NULL,
	[CondizioniPagamento] [char](10) NOT NULL,
	[Beneficiario] [char](200) NOT NULL,
	[ModalitaPagamento] [char](10) NOT NULL,
	[DataRiferimentoTerminiPagamento] [char](10) NOT NULL,
	[GiorniTerminiPagamento] [char](10) NOT NULL,
	[DataScadenzaPagamento] [char](10) NOT NULL,
	[ImportoPagamento] [char](15) NOT NULL,
	[CodUfficioPostale] [char](20) NOT NULL,
	[CognomeQuietanzante] [char](60) NOT NULL,
	[NomeQuietanzante] [char](60) NOT NULL,
	[CFQuietanzante] [char](16) NOT NULL,
	[TitoloQuietanzante] [char](10) NOT NULL,
	[IstitutoFinanziario] [char](80) NOT NULL,
	[IBAN] [char](34) NOT NULL,
	[ABI] [char](5) NOT NULL,
	[CAB] [char](5) NOT NULL,
	[BIC] [char](11) NOT NULL,
	[ScontoPagamentoAnticipato] [char](15) NOT NULL,
	[DataLimitePagamentoAnticipato] [char](10) NOT NULL,
	[PenalitaPagamentiRitardati] [char](15) NOT NULL,
	[DataDecorrenzaPenale] [char](10) NOT NULL,
	[CodicePagamento] [char](60) NOT NULL,
 CONSTRAINT [PK_FAT_ELPAG] PRIMARY KEY CLUSTERED 
(
	[ditta] ASC,
	[id] ASC,
	[idpag] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]


GO


