USE [Vertragsverwaltung]
GO

/****** Object:  Table [dbo].[LC_Dokument]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Dokument](
	[DokumentNr] [int] NOT NULL,
	[KeyValue] [int] NULL,
	[DokType] [int] NULL,
	[DokumenttypNr] [int] NULL,
	[Bezeichnung] [varchar](50) NULL,
	[Beschreibung] [varchar](2048) NULL,
	[Filename] [varchar](255) NULL,
	[OriginalFilename_incl_Path] [varchar](255) NULL,
	[Version] [varchar](50) NULL,
	[VersionsNr] [varchar](50) NULL,
	[Versionsdatum] [datetime] NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
	[SecurityLevelNr] [int] NULL,
	[DocImage] [image] NULL,
 CONSTRAINT [PK_LC_Dokument] PRIMARY KEY CLUSTERED 
(
	[DokumentNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [Default]
) ON [Default] TEXTIMAGE_ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_DokumentAblageort]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_DokumentAblageort](
	[DokumentablageortNr] [int] NOT NULL,
	[DokumentablagetypNr] [int] NULL,
	[DokumentNr] [int] NULL,
	[Ablageort] [varchar](255) NULL,
	[Beschreibung] [varchar](255) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
	[MandantNr] [int] NULL,
 CONSTRAINT [PK_LC_DokumentAblageort] PRIMARY KEY CLUSTERED 
(
	[DokumentablageortNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_DokumentAblageTyp]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_DokumentAblageTyp](
	[DokumentAblageTypNr] [int] NOT NULL,
	[Bezeichnung] [varchar](255) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
	[MandantNr] [int] NULL,
 CONSTRAINT [PK_LC_DokumentAblageTyp] PRIMARY KEY CLUSTERED 
(
	[DokumentAblageTypNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_Dokumenttyp]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Dokumenttyp](
	[Dokumenttypnr] [int] NOT NULL,
	[Bezeichnung] [varchar](255) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
 CONSTRAINT [PK_LC_Dokumenttyp] PRIMARY KEY CLUSTERED 
(
	[Dokumenttypnr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_Einsatzgebiet]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Einsatzgebiet](
	[LC_EinsatzgebietNr] [int] IDENTITY(1,1) NOT NULL,
	[LC_EinsatzgebietNr_Parent] [int] NULL,
	[Bezeichnung] [varchar](50) NULL,
	[Beschreibung] [varchar](255) NULL,
	[Erstllt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
	[Imagenr] [int] NULL,
 CONSTRAINT [PK_LC_Einsatzgebiet] PRIMARY KEY CLUSTERED 
(
	[LC_EinsatzgebietNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_Phase]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Phase](
	[LC_PhaseNr] [int] IDENTITY(1,1) NOT NULL,
	[Bezeichnung] [varchar](255) NULL,
	[Beschreibung] [varchar](1024) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
 CONSTRAINT [PK_LC_Phase] PRIMARY KEY CLUSTERED 
(
	[LC_PhaseNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_Produkt]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Produkt](
	[LC_ProduktNr] [int] NOT NULL,
	[LC_ProduktNr_Parent] [int] NULL,
	[Bezeichnung] [varchar](255) NULL,
	[Beschreibung] [varchar](1024) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
	[Imageindex] [int] NULL,
	[ProdukttypNr] [int] NULL,
	[Image] [image] NULL,
	[Version] [varchar](255) NULL,
	[StatusNr] [int] NULL,
	[Nächste_Ueberprüfung] [datetime] NULL,
	[Entscheidungstermin] [datetime] NULL,
	[Abgeloest_am] [datetime] NULL,
	[Abgeloest_durch] [varchar](255) NULL,
	[IstStruktur] [bit] NULL,
	[Verweisnr] [int] NULL,
	[TerminBemerkung] [varchar](1024) NULL,
	[Abgeloest_durch_produktnr] [int] NULL,
	[Abgeliest_durch_wen] [int] NULL,
 CONSTRAINT [PK_LC_Produkt] PRIMARY KEY CLUSTERED 
(
	[LC_ProduktNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default] TEXTIMAGE_ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_Produkt_Copy]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LC_Produkt_Copy](
	[lc_produkt_copynr] [int] NOT NULL,
	[lc_produkt_parentnr] [int] NULL,
	[lc_produktnr] [int] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
 CONSTRAINT [PK_lc_produkt_copy] PRIMARY KEY CLUSTERED 
(
	[lc_produkt_copynr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default]

GO

/****** Object:  Table [dbo].[LC_Produkt_Dokument]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Produkt_Dokument](
	[LC_Produkt_DokumentNr] [int] IDENTITY(1,1) NOT NULL,
	[LC_ProduktNr] [int] NULL,
	[Bezeichnung] [varchar](50) NULL,
	[beschreibung] [varchar](255) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
	[Dokument] [image] NULL,
 CONSTRAINT [PK_LC_Produkt_Dokument] PRIMARY KEY CLUSTERED 
(
	[LC_Produkt_DokumentNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default] TEXTIMAGE_ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_Produkt_Phase]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Produkt_Phase](
	[LC_Produkt_PhaseNr] [int] IDENTITY(1,1) NOT NULL,
	[LC_ProduktNr] [int] NULL,
	[LC_PhaseNr] [int] NULL,
	[Datum] [datetime] NULL,
	[Bemerkung] [varchar](255) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
 CONSTRAINT [PK_LC_Produkt_Phase] PRIMARY KEY CLUSTERED 
(
	[LC_Produkt_PhaseNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_ProduktImage]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LC_ProduktImage](
	[LC_ProduktImageNr] [int] IDENTITY(1,1) NOT NULL,
	[LC_ProduktNr] [int] NULL,
	[Image] [image] NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
 CONSTRAINT [PK_LC_ProduktImage] PRIMARY KEY CLUSTERED 
(
	[LC_ProduktImageNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default] TEXTIMAGE_ON [Default]

GO

/****** Object:  Table [dbo].[LC_Produkttyp]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_Produkttyp](
	[LC_Produkttypnr] [int] NOT NULL,
	[Bezeichnung] [varchar](50) NULL,
	[Beschreibung] [varchar](255) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
 CONSTRAINT [PK_LC_Produkttyp] PRIMARY KEY CLUSTERED 
(
	[LC_Produkttypnr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LC_SQL]    Script Date: 02.05.2015 09:39:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LC_SQL](
	[LC_SQLNr] [int] NOT NULL,
	[Bezeichnung] [varchar](50) NULL,
	[Beschreibung] [varchar](1024) NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Aktiv] [bit] NULL,
 CONSTRAINT [PK_LC_SQL] PRIMARY KEY CLUSTERED 
(
	[LC_SQLNr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Default]
) ON [Default]

GO

SET ANSI_PADDING OFF
GO


