if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarListe]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarListe] (
	[IDLista] [int] NOT NULL ,
	[Descreizione] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
	[IDCategoriaProd] [int] NULL ,
	[Sfondo] [varchar] (12) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarBlocchi]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarBlocchi] (
	[IdLista] [int] NOT NULL ,
	[IdBlocco] [int] NOT NULL ,
	[IdMenu] [int] NOT NULL 
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarListeRighe]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarListeRighe] (
	[IDLista] [int] NOT NULL ,
	[IDPosizione] [int] NOT NULL ,
	[IDProdotto] [int] NOT NULL ,
	[Descrizione] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
	[ColoreRiga] [varchar] (12) COLLATE Latin1_General_CI_AS NULL ,
	[Sfondoriga] [varchar] (12) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarMenu]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarMenu] (
	[IDMenu] [int] NULL ,
	[DescMenu] [varchar] (20) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarOperatori]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarOperatori] (
	[IDOperatore] [int] NOT NULL ,
	[Nominativo] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
	[Ruolo] [varchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[Permessi] [varchar] (10) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarTavili]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarTavili] (
	[IDTavolo] [int] NOT NULL ,
	[Descrizione] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
	[ApertoChiuso] [varchar] (6) COLLATE Latin1_General_CI_AS NULL ,
	[OraAperto] [datetime] NULL ,
	[IDOperatoreApertura] [int] NULL 
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BarTavoliOrdine]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[BarTavoliOrdine] (
	[IDTavolo] [int] NOT NULL ,
	[IDProdotto] [int] NULL ,
	[NumeroRiga] [int] NOT NULL ,
	[Qta] [decimal](18, 6) NULL ,
	[PrezzoUnitario] [decimal](18, 6) NULL ,
	[PrezzoRiga] [decimal](18, 6) NULL ,
	[OraOrdinazione] [datetime] NULL ,
	[IDOperatore] [int] NULL ,
	[BancoTavolo] [varchar] (6) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

