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

CREATE TABLE [Kassenbericht] (
	[ID] [bigint] IDENTITY (1, 1) NOT NULL ,
	[Filiale] [int] NULL ,
	[Datum] [datetime] NULL ,
	[Artikelnummer] [varchar] (40) COLLATE Latin1_General_CI_AS NULL ,
	[Anzahl] [float] NULL ,
	[EPreis] [float] NULL ,
	[EK] [float] NULL ,
	[GRohertrag] [float] NULL ,
	[GPreis] [float] NULL ,
	[WG_Nr] [varchar] (40) COLLATE Latin1_General_CI_AS NULL ,
	[Lieferantennr] [varchar] (40) NULL ,
	[Auftrag] [int] NULL ,
	[gebucht] [int] NULL 
) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht] ON [Kassenbericht]([Filiale], [Artikelnummer]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_1] ON [Kassenbericht]([Datum], [Artikelnummer]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_2] ON [Kassenbericht]([Artikelnummer], [Datum]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_3] ON [Kassenbericht]([WG_Nr], [Datum]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_4] ON [Kassenbericht]([Filiale], [Datum]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_5] ON [Kassenbericht]([Datum], [WG_Nr]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_6] ON [Kassenbericht]([Datum], [Lieferantennr]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_7] ON [Kassenbericht]([Filiale], [Datum], [WG_Nr]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_8] ON [Kassenbericht]([Auftrag]) ON [PRIMARY]
###

 CREATE  INDEX [IX_Kassenbericht_9] ON [Kassenbericht]([gebucht] DESC ) ON [PRIMARY]
###

