USE [ROMICO-CTI]
GO
/****** Object:  Table [dbo].[Protocol]    Script Date: 09/18/2008 13:41:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Protocol](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Line] [varchar](50) NULL,
	[Benutzer] [varchar](80) NULL,
	[MasterLine] [varchar](50) NULL,
	[TimeStart] [numeric](18, 10) NOT NULL CONSTRAINT [DF_Protocol_TimeStart]  DEFAULT ((0)),
	[TimeConnect] [numeric](18, 10) NOT NULL CONSTRAINT [DF_Protocol_TimeConnect]  DEFAULT ((0)),
	[TimeEnd] [numeric](18, 10) NOT NULL CONSTRAINT [DF_Protocol_TimeEnd]  DEFAULT ((0)),
	[Start] [varchar](20) NULL,
	[Connect] [varchar](20) NULL,
	[End] [varchar](20) NULL,
	[Duration] [int] NOT NULL CONSTRAINT [DF_Protocol_Duration]  DEFAULT ((0)),
	[Telefonnummer] [varchar](50) NULL,
	[CompletePhoneNumber] [varchar](50) NULL,
	[CalledID] [varchar](50) NULL,
	[TargetID] [varchar](50) NULL,
	[Origin] [smallint] NOT NULL DEFAULT ((0)),
	[Outgoing] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Outgoing]  DEFAULT ((0)),	
	[CallType] [varchar](50) NULL,
	[hCall] [int] NOT NULL DEFAULT ((0)),
	[RedirectingID] [varchar](50) NULL,
	[RedirectionID] [varchar](50) NULL,
	[Name1] [varchar](255) NULL,
	[Name2] [varchar](255) NULL,
	[Company] [varchar](255) NULL,
	[Email] [varchar](255) NULL,
	[ExtraField] [varchar](50) NULL,
	[UserGroupID] [int] NOT NULL CONSTRAINT [DF_Protocol_UserGroupID]  DEFAULT ((0)),
	[UserFirmID] [int] NOT NULL CONSTRAINT [DF_Protocol_UserFirmID]  DEFAULT ((-1)),
	[RedirectChecked] [smallint] NOT NULL CONSTRAINT [DF_Protocol_RedirectChecked]  DEFAULT ((0)),
	[Redirected] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Redirected]  DEFAULT ((0)),
	[Picked] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Picked]  DEFAULT ((0)),
	[RedDestLine] [varchar](30) NULL,
	[RedDestRecId] [int] NOT NULL CONSTRAINT [DF_Protocol_RedDestRecId]  DEFAULT ((0)),
	[RedSourceRecId] [int] NOT NULL DEFAULT ((0)),
	[CallBackHoursRange] [real] NOT NULL CONSTRAINT [DF_Protocol_CallBackHoursRange]  DEFAULT ((0)),
	[CallBackFoundOutgoing] [smallint] NOT NULL CONSTRAINT [DF_Protocol_CallBackFoundOutgoing]  DEFAULT ((0)),
	[CallBackFoundRecId] [int] NOT NULL CONSTRAINT [DF_Protocol_CallBackFoundRecId]  DEFAULT ((0)),
	[Provider] [varchar](50) NULL,
	[Price] [numeric](18, 10) NOT NULL CONSTRAINT [DF_Protocol_Price]  DEFAULT ((0)),
	[Percent] [numeric](18, 10) NOT NULL CONSTRAINT [DF_Protocol_Percent]  DEFAULT ((0)),
	[MailBoxFile] [varchar](255) NULL,
	[MailBoxFileListened] [smallint] NOT NULL DEFAULT ((0)),
	[UserOnline] [smallint] NOT NULL CONSTRAINT [DF_Protocol_UserOnline]  DEFAULT ((0)),
	[Abgeholt] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Abgeholt]  DEFAULT ((0)),
	[Marked] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Marked]  DEFAULT ((0)),
	[LastChange] [numeric](18, 10) NOT NULL CONSTRAINT [DF_Protocol_LastChange]  DEFAULT (CONVERT([numeric](18,10),getdate(),(0))),
	[CPhoneNumber] [varchar](50) NULL,
	[Show] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Show]  DEFAULT ((0)),
	[Status] [smallint] NOT NULL CONSTRAINT [DF_Protocol_Status]  DEFAULT ((0)),
	[FollowMe] [int] NOT NULL DEFAULT ((0)),

 CONSTRAINT [PK_Protocol] PRIMARY KEY CLUSTERED 
(
	[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]

GO
SET ANSI_PADDING OFF


GO
/****** Object:  Index [IX_Duration]    Script Date: 09/03/2008 09:57:32 ******/
CREATE NONCLUSTERED INDEX [IX_Duration] ON [dbo].[Protocol] 
(
	[Duration] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO
/****** Object:  Index [IX_Line]    Script Date: 09/03/2008 09:58:04 ******/
CREATE NONCLUSTERED INDEX [IX_Line] ON [dbo].[Protocol] 
(
	[Line] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO
/****** Object:  Index [IX_Telefonnummer]    Script Date: 09/03/2008 09:58:37 ******/
CREATE NONCLUSTERED INDEX [IX_Telefonnummer] ON [dbo].[Protocol] 
(
	[Telefonnummer] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO
/****** Object:  Index [IX_TimeStart]    Script Date: 09/03/2008 09:59:07 ******/
CREATE NONCLUSTERED INDEX [IX_TimeStart] ON [dbo].[Protocol] 
(
	[TimeStart] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO
/****** Object:  Index [IX_LastChange]    Script Date: 09/08/2008 14:16:58 ******/
CREATE NONCLUSTERED INDEX [IX_LastChange] ON [dbo].[Protocol] 
(
	[LastChange] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO
/****** Object:  Index [IX_Marked]    Script Date: 09/08/2008 14:17:59 ******/
CREATE NONCLUSTERED INDEX [IX_Marked] ON [dbo].[Protocol] 
(
	[Marked] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_CompletePhoneNumber]    Script Date: 09/22/2008 13:37:00 ******/
CREATE NONCLUSTERED INDEX [IX_CompletePhoneNumber] ON [dbo].[Protocol] 
(
	[CompletePhoneNumber] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
/****** Object:  Index [IX_UserGroupID]    Script Date: 09/26/2008 09:40:06 ******/
CREATE NONCLUSTERED INDEX [IX_UserGroupID] ON [dbo].[Protocol] 
(
	[UserGroupID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO
/****** Object:  Index [IX_Benutzer]    Script Date: 02/09/2009 10:08:21 ******/
CREATE NONCLUSTERED INDEX [IX_Benutzer] ON [dbo].[Protocol] 
(
	[Benutzer] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Provider]    Script Date: 02/09/2009 10:11:27 ******/
CREATE NONCLUSTERED INDEX [IX_Provider] ON [dbo].[Protocol] 
(
	[Provider] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Outgoing]    Script Date: 02/09/2009 10:13:19 ******/
CREATE NONCLUSTERED INDEX [IX_Outgoing] ON [dbo].[Protocol] 
(
	[Outgoing] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_MasterLine]    Script Date: 02/09/2009 10:15:57 ******/
CREATE NONCLUSTERED INDEX [IX_MasterLine] ON [dbo].[Protocol] 
(
	[MasterLine] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_TimeEnd]    Script Date: 02/09/2009 10:15:57 ******/
CREATE NONCLUSTERED INDEX [IX_TimeEnd] ON [dbo].[Protocol] 
(
	[TimeEnd] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_TargetID]    Script Date: 09/03/2008 09:58:37 ******/
CREATE NONCLUSTERED INDEX [IX_TargetID] ON [dbo].[Protocol] 
(
	[TargetID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO