﻿CREATE TABLE [consulenzaUnica].[dbo].[Contratto] (
    [codiceContratto] varchar(11) NOT NULL,
    [chiaveClientePB] bigint NOT NULL,
    [status] varchar(50) NULL,
    [dtFirmaBase] datetime NULL,
    [dtEndBase] datetime NULL,
    [dtFirmaSei] datetime NULL,
    [dtEndSei] datetime NULL,
    [dtvalid] datetime NULL,
    [dtProcBase] date NULL,
    [dtProcAv] date NULL,
    [address] varchar(512) NULL,
    [cap] varchar(512) NULL,
    [city] varchar(512) NULL,
    [province] varchar(512) NULL,
    [nation] varchar(512) NULL,
    [presso] varchar(512) NULL,
    [rangeCpp] varchar(512) NULL,
    [genReport] varchar(512) NULL,
    [genBilling] varchar(512) NULL,
    [email] varchar(512) NULL,
    [freqRepDia] varchar(512) NULL,
    [freqRepMon] varchar(512) NULL,
    [dtFirma] date NULL,
    [progLastSending] int NULL,
    [dtLastSending] date NULL,
    [dtLastProcessing] date NULL,
    [newFreqRepDia] varchar(512) NULL,
    [newFreqRepmon] varchar(512) NULL,
    [dtStartFreqRep] date NULL,
    [newDtStartReqRep] date NULL,
    [note] varchar(512) NULL,
    [flSrdef] varchar(1) NULL,
    [flagRol] varchar(1) NULL,
    [TipContratto] varchar(1) NULL,
    [ModPagamento] varchar(1) NULL,
    [codStatoContratto] int NULL,
    [flagpiansuc] char(1) NULL,
    [flagimmobiliare] char(1) NULL,
    [TIPOCONSULENZA] char(1) NULL,
    [flagamministrato] varchar(2) NULL
);
GO

-- Popolamento tabella
-- INSERT INTO [consulenzaUnica].[dbo].[Contratto]
-- SELECT * FROM [CONSUNI].[consulenzaUnica].[dbo].[Contratto];
-- GO