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

/****** Object:  Table [dbo].[[FAT_ARCARR]]    Script Date: 19/04/2018 16:29:38 ******/
BEGIN

CREATE TABLE [dbo].[FAT_ARCARR](
	[ditta] [int] NOT NULL CONSTRAINT [DF_FAT_ARCARR_ditta]  DEFAULT ((0)),
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[mittente] [char](200) NOT NULL CONSTRAINT [DF_FAT_ARCARR_mittente]  DEFAULT (''),
	[tipo] [char](10) NOT NULL CONSTRAINT [DF_FAT_ARCARR_tipo]  DEFAULT (''),
	[data] [char](10) NOT NULL CONSTRAINT [DF_FAT_ARCARR_data]  DEFAULT (''),
	[numero] [char](50) NOT NULL CONSTRAINT [DF_FAT_ARCARR_numero]  DEFAULT (''),
	[filexml] [image] NOT NULL CONSTRAINT [DF_FAT_ARCARR_filexml]  DEFAULT (''),
	[archiviata] [int] NOT NULL CONSTRAINT [DF_FAT_ARCARR_archiviata]  DEFAULT ((0)),
	[nomefilexlm] [char](50) NOT NULL CONSTRAINT [DF_FAT_ARCARR_nomefilexlm]  DEFAULT (''),
	[indirizzo] [char](200) NOT NULL CONSTRAINT [DF_FAT_ARCARR_indirizzo]  DEFAULT (''),
	[partitaiva] [char](30) NOT NULL CONSTRAINT [DF_FAT_ARCARR_partitaiva]  DEFAULT (''),
	[codicefiscale] [char](30) NOT NULL CONSTRAINT [DF_FAT_ARCARR_codicefiscale]  DEFAULT (''),
 CONSTRAINT [PK_FAT_ARCARR] PRIMARY KEY CLUSTERED 
(
	[ditta] ASC,
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

END
