CREATE TABLE [dbo].[absent] (
	[fromdate] [datetime] NULL ,
	[fromtime] [datetime] NULL ,
	[todate] [datetime] NULL ,
	[totime] [datetime] NULL ,
	[description] [varchar] (1024) NULL ,
	[parentid] [int] NULL ,
	[id] [int] NOT NULL ,
	[parttime] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[action] (
	[defaultresult] [varchar] (64) NULL ,
	[scriptname] [varchar] (64) NULL ,
	[consumeddays] [int] NULL ,
	[consumedhours] [int] NULL ,
	[consumedminutes] [int] NULL ,
	[consumedseconds] [int] NULL ,
	[estimateddays] [int] NULL ,
	[estimatedhours] [int] NULL ,
	[estimatedminutes] [int] NULL ,
	[estimatedseconds] [int] NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[termdate] [datetime] NULL ,
	[termtime] [datetime] NULL ,
	[parentid] [int] NOT NULL ,
	[classtype] [char] (2) NOT NULL ,
	[processoption] [varchar] (64) NULL ,
	[name] [varchar] (64) NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[id] [int] NOT NULL ,
	[symbolname] [varchar] (64) NULL ,
	[execution] [int] NULL ,
	[resources] [varchar] (2000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[actionhistory] (
	[description] [varchar] (2000) NULL ,
	[commentstring] [varchar] (4000) NULL ,
	[parentid] [int] NULL ,
	[id] [int] NOT NULL ,
	[type] [varchar] (64) NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[enddate] [datetime] NULL ,
	[endtime] [datetime] NULL ,
	[name] [varchar] (64) NULL ,
	[category] [varchar] (64) NULL ,
	[symbolname] [varchar] (64) NULL ,
	[mandatory] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[actiontemplate] (
	[consumeddays] [int] NULL ,
	[consumedhours] [int] NULL ,
	[consumedminutes] [int] NULL ,
	[consumedseconds] [int] NULL ,
	[estimateddays] [int] NULL ,
	[estimatedhours] [int] NULL ,
	[estimatedminutes] [int] NULL ,
	[estimatedseconds] [int] NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[termdate] [datetime] NULL ,
	[termtime] [datetime] NULL ,
	[parentid] [int] NOT NULL ,
	[classtype] [char] (2) NOT NULL ,
	[processoption] [varchar] (64) NULL ,
	[name] [varchar] (64) NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[defaultresult] [varchar] (64) NULL ,
	[scriptname] [varchar] (64) NULL ,
	[symbolname] [varchar] (64) NULL ,
	[resources] [varchar] (2000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[adoptvisibility] (
	[inheritance] [varchar] (64) NOT NULL ,
	[bearbeiterid] [int] NULL ,
	[parentid] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[adresse] (
	[id] [int] NOT NULL ,
	[name] [varchar] (64) NULL ,
	[first_name] [varchar] (64) NULL ,
	[zip_code] [varchar] (20) NULL ,
	[town] [varchar] (64) NULL ,
	[street] [varchar] (64) NULL ,
	[phone] [varchar] (32) NULL ,
	[description] [varchar] (2000) NULL ,
	[fax] [varchar] (32) NULL ,
	[eMail] [varchar] (64) NULL ,
	[term] [varchar] (128) NULL ,
	[location] [varchar] (128) NULL ,
	[company] [varchar] (128) NULL ,
	[attachment] [varchar] (128) NULL ,
	[branch] [varchar] (64) NULL ,
	[portrait] [varchar] (4000) NULL ,
	[portrait2] [varchar] (4000) NULL ,
	[portrait3] [varchar] (4000) NULL ,
	[labelgroup] [varchar] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[authorisierung] (
	[name] [varchar] (64) NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[rights] [varchar] (2000) NULL ,
	[parentid] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[authorisierungsvererbung] (
	[inheritance] [varchar] (64) NULL ,
	[bearbeiterid] [int] NULL ,
	[parentid] [int] NOT NULL ,
	[denyworker] [bit] NULL ,
	[denyorganigram] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[bearbeiter] (
	[id] [int] NOT NULL ,
	[shortcut] [varchar] (40) NULL ,
	[password] [varchar] (128) NULL ,
	[description] [varchar] (2000) NULL ,
	[parentid] [int] NULL ,
	[classtype] [char] (2) NULL ,
	[address] [int] NULL ,
	[visibilityid] [int] NULL ,
	[authorize_inheritanceid] [int] NULL ,
	[adoptvisibilityid] [int] NULL ,
	[workdayhours] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[historyprocessdataentry] (
	[name] [varchar] (64) NOT NULL ,
	[parentid] [int] NOT NULL ,
	[id] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[historyprocessdataitem] (
	[keystring] [varchar] (64) NOT NULL ,
	[valuestring] [varchar] (4000) NULL ,
	[parentid] [int] NOT NULL ,
	[valuedate] [datetime] NULL ,
	[valuetime] [datetime] NULL ,
	[valueboolean] [smallint] NULL ,
	[valueinteger] [int] NULL ,
	[valuedouble] [decimal](18, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[locking] (
	[locked] [varchar] (64) NOT NULL ,
	[id] [int] NOT NULL ,
	[locker] [varchar] (64) NULL ,
	[date] [datetime] NULL ,
	[time] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[process] (
	[description] [varchar] (2000) NULL ,
	[priority] [int] NULL ,
	[firststepid] [int] NULL ,
	[currentstepid] [int] NULL ,
	[name] [varchar] (64) NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[parentid] [int] NOT NULL ,
	[id] [int] NOT NULL ,
	[lastprocessed] [int] NULL ,
	[margin] [int] NULL ,
	[orientation] [varchar] (64) NULL ,
	[labelorientation] [varchar] (64) NULL ,
	[spacingbetweencolumns] [int] NULL ,
	[spacingbetweenrows] [int] NULL ,
	[logicalname] [varchar] (256) NULL ,
	[reddelay] [int] NULL ,
	[yellowdelay] [int] NULL ,
	[cyclic] [bit] NULL ,
	[subprocess] [bit] NULL ,
	[startedby] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[processdataentry] (
	[name] [varchar] (64) NOT NULL ,
	[parentid] [int] NOT NULL ,
	[id] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[processdataitem] (
	[keystring] [varchar] (64) NOT NULL ,
	[valuestring] [varchar] (4000) NULL ,
	[parentid] [int] NOT NULL ,
	[valuedate] [datetime] NULL ,
	[valuetime] [datetime] NULL ,
	[valueboolean] [smallint] NULL ,
	[valueinteger] [int] NULL ,
	[valuedouble] [decimal](18, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[processhistory] (
	[id] [int] NOT NULL ,
	[runningid] [int] NULL ,
	[description] [varchar] (2000) NULL ,
	[starter] [varchar] (1024) NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[enddate] [datetime] NULL ,
	[endtime] [datetime] NULL ,
	[parentid] [int] NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[name] [varchar] (64) NOT NULL ,
	[abort] [int] NULL ,
	[commentstring] [varchar] (4000) NULL ,
	[logicalname] [varchar] (256) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[processtemplate] (
	[description] [varchar] (2000) NULL ,
	[priority] [int] NULL ,
	[firststepid] [int] NULL ,
	[currentstepid] [int] NULL ,
	[name] [varchar] (64) NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[parentid] [int] NOT NULL ,
	[margin] [int] NULL ,
	[orientation] [varchar] (64) NULL ,
	[labelorientation] [varchar] (64) NULL ,
	[spacingbetweencolumns] [int] NULL ,
	[spacingbetweenrows] [int] NULL ,
	[reddelay] [int] NULL ,
	[yellowdelay] [int] NULL ,
	[subprocess] [bit] NULL ,
	[notStartable] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[question] (
	[asker] [varchar] (256) NULL ,
	[asked] [varchar] (256) NULL ,
	[subject] [varchar] (1024) NULL ,
	[question] [varchar] (4000) NULL ,
	[id] [int] NOT NULL ,
	[parentid] [int] NULL ,
	[answer] [varchar] (4000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[resources] (
	[id] [int] NOT NULL ,
	[parentid] [int] NOT NULL ,
	[base] [varchar] (128) NULL ,
	[calculate] [bit] NULL ,
	[cost] [decimal](18, 0) NULL ,
	[factor] [decimal](18, 0) NULL ,
	[unit] [varchar] (128) NULL ,
	[description] [varchar] (2000) NULL ,
	[name] [varchar] (64) NOT NULL ,
	[executiontime] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[scheduledresources] (
	[id] [int] NOT NULL ,
	[parentid] [int] NOT NULL ,
	[base] [varchar] (128) NULL ,
	[calculate] [bit] NULL ,
	[cost] [decimal](18, 0) NULL ,
	[factor] [decimal](18, 0) NULL ,
	[unit] [varchar] (128) NULL ,
	[description] [varchar] (2000) NULL ,
	[name] [varchar] (64) NOT NULL ,
	[executiontime] [bit] NULL ,
	[consumed] [decimal](18, 0) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[script] (
	[id] [int] NOT NULL ,
	[parentid] [int] NULL ,
	[name] [varchar] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[scriptmethodsource] (
	[startMethod] [bit] NOT NULL ,
	[source] [varchar] (4000) NULL ,
	[id] [int] NOT NULL ,
	[name] [varchar] (64) NULL ,
	[arguments] [varchar] (2000) NULL ,
	[parentid] [int] NULL ,
	[source2] [varchar] (4000) NULL ,
	[source3] [varchar] (4000) NULL ,
	[source4] [varchar] (4000) NULL ,
	[systemmethod] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[SerialNumbers] (
	[tableName] [varchar] (50) NOT NULL ,
	[columnName] [varchar] (50) NOT NULL ,
	[lastNumber] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[setting] (
	[parent] [int] NOT NULL ,
	[key] [varchar] (255) NOT NULL ,
	[valuestring] [varchar] (4000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[step] (
	[name] [varchar] (64) NULL ,
	[category] [varchar] (64) NULL ,
	[id] [int] NOT NULL ,
	[bearbeiterid] [int] NULL ,
	[processoption] [varchar] (64) NULL ,
	[description] [varchar] (2000) NULL ,
	[consumeddays] [int] NULL ,
	[consumedhours] [int] NULL ,
	[consumedminutes] [int] NULL ,
	[consumedseconds] [int] NULL ,
	[estimateddays] [int] NULL ,
	[estimatedhours] [int] NULL ,
	[estimatedminutes] [int] NULL ,
	[estimatedseconds] [int] NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[termdate] [datetime] NULL ,
	[termtime] [datetime] NULL ,
	[history] [varchar] (2000) NULL ,
	[usecurrentworker] [bit] NOT NULL ,
	[symbolname] [varchar] (64) NULL ,
	[wait] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[stephistory] (
	[id] [int] NOT NULL ,
	[description] [varchar] (2000) NULL ,
	[commentstring] [varchar] (4000) NULL ,
	[parentid] [int] NULL ,
	[starter] [varchar] (1024) NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[enddate] [datetime] NULL ,
	[endtime] [datetime] NULL ,
	[name] [varchar] (64) NULL ,
	[category] [varchar] (64) NULL ,
	[result] [varchar] (64) NULL ,
	[startnextdate] [datetime] NULL ,
	[startnexttime] [datetime] NULL ,
	[delegated] [varchar] (1024) NULL ,
	[targetstartdate] [datetime] NULL ,
	[targetstarttime] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[stepresult] (
	[parentid] [int] NOT NULL ,
	[nextstepid] [int] NULL ,
	[typeoftime] [varchar] (64) NULL ,
	[durationdays] [int] NULL ,
	[durationhours] [int] NULL ,
	[durationminutes] [int] NULL ,
	[durationseconds] [int] NULL ,
	[dayofweek] [int] NULL ,
	[timeofweek] [datetime] NULL ,
	[dayofmonth] [int] NULL ,
	[timeofmonth] [datetime] NULL ,
	[abs_date] [datetime] NULL ,
	[abs_time] [datetime] NULL ,
	[name] [varchar] (64) NOT NULL ,
	[id] [int] NOT NULL ,
	[sequ] [int] NULL ,
	[stoptime] [bit] NULL ,
	[description] [varchar] (2000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[stepresulttemplate] (
	[parentid] [int] NOT NULL ,
	[nextstepid] [int] NULL ,
	[typeoftime] [varchar] (64) NULL ,
	[durationdays] [int] NULL ,
	[durationhours] [int] NULL ,
	[durationminutes] [int] NULL ,
	[durationseconds] [int] NULL ,
	[dayofweek] [int] NULL ,
	[timeofweek] [datetime] NULL ,
	[dayofmonth] [int] NULL ,
	[timeofmonth] [datetime] NULL ,
	[abs_date] [datetime] NULL ,
	[abs_time] [datetime] NULL ,
	[name] [varchar] (64) NOT NULL ,
	[id] [int] NOT NULL ,
	[sequ] [int] NULL ,
	[stoptime] [bit] NULL ,
	[description] [varchar] (2000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[steptemplate] (
	[name] [varchar] (64) NULL ,
	[category] [varchar] (64) NULL ,
	[id] [int] NOT NULL ,
	[processoption] [varchar] (64) NULL ,
	[description] [varchar] (2000) NULL ,
	[consumeddays] [int] NULL ,
	[consumedhours] [int] NULL ,
	[consumedminutes] [int] NULL ,
	[consumedseconds] [int] NULL ,
	[estimateddays] [int] NULL ,
	[estimatedhours] [int] NULL ,
	[estimatedminutes] [int] NULL ,
	[estimatedseconds] [int] NULL ,
	[startdate] [datetime] NULL ,
	[starttime] [datetime] NULL ,
	[termdate] [datetime] NULL ,
	[termtime] [datetime] NULL ,
	[bearbeiterid] [int] NULL ,
	[usecurrentworker] [bit] NOT NULL ,
	[symbolname] [varchar] (64) NULL ,
	[wait] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[substitute] (
	[substitutedid] [int] NOT NULL ,
	[substituterid] [int] NOT NULL ,
	[name] [varchar] (64) NOT NULL ,
	[category] [varchar] (64) NOT NULL ,
	[classtype] [char] (2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[taskarea] (
	[parentid] [int] NOT NULL ,
	[name] [varchar] (64) NOT NULL ,
	[workerid] [int] NOT NULL ,
	[description] [varchar] (2000) NULL ,
	[permissions] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[trans] (
	[a] [int] NULL ,
	[b] [int] NULL ,
	[c] [int] NULL ,
	[d] [int] NULL ,
	[e] [int] NULL ,
	[id] [int] NOT NULL ,
	[f] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[visibility] (
	[inheritance] [varchar] (64) NOT NULL ,
	[bearbeiterid] [int] NULL ,
	[parentid] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[waiting] (
	[parent] [int] NULL ,
	[waitingfor] [int] NULL ,
	[id] [int] NOT NULL ,
	[asynchron] [bit] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[absent] WITH NOCHECK ADD 
	CONSTRAINT [PK_absent] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[action] WITH NOCHECK ADD 
	CONSTRAINT [PK_action] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[actionhistory] WITH NOCHECK ADD 
	CONSTRAINT [PK_actionhistory] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[actiontemplate] WITH NOCHECK ADD 
	CONSTRAINT [PK_actiontemplate] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid],
		[classtype],
		[name],
		[category]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[adoptvisibility] WITH NOCHECK ADD 
	CONSTRAINT [PK_adoptvisibility] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[adresse] WITH NOCHECK ADD 
	CONSTRAINT [PK_adresse] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[authorisierung] WITH NOCHECK ADD 
	CONSTRAINT [PK_authorisierung] PRIMARY KEY  NONCLUSTERED 
	(
		[name],
		[category],
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[authorisierungsvererbung] WITH NOCHECK ADD 
	CONSTRAINT [PK_authorisierungsvererbung] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[bearbeiter] WITH NOCHECK ADD 
	CONSTRAINT [PK_bearbeiter] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[historyprocessdataentry] WITH NOCHECK ADD 
	CONSTRAINT [PK_historyprocessdataentry] PRIMARY KEY  NONCLUSTERED 
	(
		[name],
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[historyprocessdataitem] WITH NOCHECK ADD 
	CONSTRAINT [PK_historyprocessdataitem] PRIMARY KEY  NONCLUSTERED 
	(
		[keystring],
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[locking] WITH NOCHECK ADD 
	CONSTRAINT [PK_locking] PRIMARY KEY  NONCLUSTERED 
	(
		[locked],
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[process] WITH NOCHECK ADD 
	CONSTRAINT [PK_process] PRIMARY KEY  NONCLUSTERED 
	(
		[name],
		[category],
		[parentid],
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[processdataentry] WITH NOCHECK ADD 
	CONSTRAINT [PK_processdataentry] PRIMARY KEY  NONCLUSTERED 
	(
		[name],
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[processdataitem] WITH NOCHECK ADD 
	CONSTRAINT [PK_processdataitem] PRIMARY KEY  NONCLUSTERED 
	(
		[keystring],
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[processhistory] WITH NOCHECK ADD 
	CONSTRAINT [PK_processhistory] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[processtemplate] WITH NOCHECK ADD 
	CONSTRAINT [PK_processtemplate] PRIMARY KEY  NONCLUSTERED 
	(
		[name],
		[category],
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[question] WITH NOCHECK ADD 
	CONSTRAINT [PK_question] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[resources] WITH NOCHECK ADD 
	CONSTRAINT [PK_resources] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[scheduledresources] WITH NOCHECK ADD 
	CONSTRAINT [PK_scheduledresources] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[script] WITH NOCHECK ADD 
	CONSTRAINT [PK_script] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[scriptmethodsource] WITH NOCHECK ADD 
	CONSTRAINT [PK_scriptmethodsource] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[SerialNumbers] WITH NOCHECK ADD 
	CONSTRAINT [PK_SerialNumbers] PRIMARY KEY  NONCLUSTERED 
	(
		[tableName],
		[columnName]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[setting] WITH NOCHECK ADD 
	CONSTRAINT [PK_setting] PRIMARY KEY  NONCLUSTERED 
	(
		[parent],
		[key]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[step] WITH NOCHECK ADD 
	CONSTRAINT [PK_step] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[stephistory] WITH NOCHECK ADD 
	CONSTRAINT [PK_stephistory] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[stepresult] WITH NOCHECK ADD 
	CONSTRAINT [PK_stepresult] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid],
		[name],
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[stepresulttemplate] WITH NOCHECK ADD 
	CONSTRAINT [PK_stepresulttemplate] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid],
		[name],
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[steptemplate] WITH NOCHECK ADD 
	CONSTRAINT [PK_steptemplate] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[substitute] WITH NOCHECK ADD 
	CONSTRAINT [PK_substitute] PRIMARY KEY  NONCLUSTERED 
	(
		[substitutedid],
		[name],
		[category]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[taskarea] WITH NOCHECK ADD 
	CONSTRAINT [PK_taskarea] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid],
		[name]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[trans] WITH NOCHECK ADD 
	CONSTRAINT [PK_transaction] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[visibility] WITH NOCHECK ADD 
	CONSTRAINT [PK_bearbeitersicht] PRIMARY KEY  NONCLUSTERED 
	(
		[parentid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[waiting] WITH NOCHECK ADD 
	CONSTRAINT [PK_waiting] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_action] ON [dbo].[action]([parentid]) ON [PRIMARY]
GO

