Смекни!
smekni.com

Разработка информационно-аналитической системы контакт-центра (стр. 12 из 13)

CREATE DATABASE [simpaza] ON PRIMARY

(NAME = N'simpaza', FILENAME = N'C: \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\simpaza. mdf', SIZE = 2048KB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB)

LOG ON

(NAME = N'simpaza_log', FILENAME = N'C: \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\simpaza_log. ldf', SIZE = 1024KB, MAXSIZE = 2048GB, FILEGROWTH = 10%)

COLLATE SQL_Latin1_General_CP1_CI_AS

GO

EXEC dbo. sp_dbcmptlevel @dbname=N'simpaza', @new_cmptlevel=90

GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))

begin

EXEC [simpaza]. [dbo]. [sp_fulltext_database] @action = 'disable'

end

GO

ALTER DATABASE [simpaza] SET ANSI_NULL_DEFAULT OFF

GO

ALTER DATABASE [simpaza] SET ANSI_NULLS OFF

GO

ALTER DATABASE [simpaza] SET ANSI_PADDING OFF

GO

ALTER DATABASE [simpaza] SET ANSI_WARNINGS OFF

GO

ALTER DATABASE [simpaza] SET ARITHABORT OFF

GO

ALTER DATABASE [simpaza] SET AUTO_CLOSE OFF

GO

ALTER DATABASE [simpaza] SET AUTO_CREATE_STATISTICS ON

GO

ALTER DATABASE [simpaza] SET AUTO_SHRINK OFF

GO

ALTER DATABASE [simpaza] SET AUTO_UPDATE_STATISTICS ON

GO

ALTER DATABASE [simpaza] SET CURSOR_CLOSE_ON_COMMIT OFF

GO

ALTER DATABASE [simpaza] SET CURSOR_DEFAULT GLOBAL

GO

ALTER DATABASE [simpaza] SET CONCAT_NULL_YIELDS_NULL OFF

GO

ALTER DATABASE [simpaza] SET NUMERIC_ROUNDABORT OFF

GO

ALTER DATABASE [simpaza] SET QUOTED_IDENTIFIER OFF

GO

ALTER DATABASE [simpaza] SET RECURSIVE_TRIGGERS OFF

GO

ALTER DATABASE [simpaza] SET ENABLE_BROKER

GO

ALTER DATABASE [simpaza] SET AUTO_UPDATE_STATISTICS_ASYNC OFF

GO

ALTER DATABASE [simpaza] SET DATE_CORRELATION_OPTIMIZATION OFF

GO

ALTER DATABASE [simpaza] SET TRUSTWORTHY OFF

GO

ALTER DATABASE [simpaza] SET ALLOW_SNAPSHOT_ISOLATION OFF

GO

ALTER DATABASE [simpaza] SET PARAMETERIZATION SIMPLE

GO

ALTER DATABASE [simpaza] SET READ_WRITE

GO

ALTER DATABASE [simpaza] SET RECOVERY FULL

GO

ALTER DATABASE [simpaza] SET MULTI_USER

GO

ALTER DATABASE [simpaza] SET PAGE_VERIFY CHECKSUM

GO

ALTER DATABASE [simpaza] SET DB_CHAINING OFF

/ ****** Object: Login [simp] Script Date: 04/06/2009 06: 38: 59 ****** /

/ * For security reasons the login is created disabled and with a random password. * /

/ ****** Object: Login [simp] Script Date: 04/06/2009 06: 38: 59 ****** /

CREATE LOGIN [simp] WITH PASSWORD=N'›ÝAS¯! ‰s¤i_þ¹R$ßˤ½EÖ

aYêËl1_³; ', DEFAULT_DATABASE= [simpaza], DEFAULT_LANGUAGE= [us_english], CHECK_EXPIRATION=ON, CHECK_POLICY=ON

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'sysadmin'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'securityadmin'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'serveradmin'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'setupadmin'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'processadmin'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'diskadmin'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'dbcreator'

GO

EXEC sys. sp_addsrvrolemember @loginame = N'simp', @rolename = N'bulkadmin'

GO

ALTER LOGIN [simp] DISABLE

USE [simpaza]

GO

/ ****** Object: Table [dbo]. [Manager] Script Date: 04/06/2009 06: 54: 40 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo]. [Manager] (

[Id_manager] [bigint] IDENTITY(1,1) NOT NULL,

[FIO_manager] [varchar] (30) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Login] [varchar] (20) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Pass] [varchar] (20) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Level] [bigint] NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

USE [simpaza]

GO

/ ****** Object: Table [dbo]. [Status] Script Date: 04/06/2009 06: 55: 04 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo]. [Status] (

[Id_status] [int] IDENTITY(1,1) NOT NULL,

[Status] [varchar] (20) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

USE [simpaza]

GO

/ ****** Object: Table [dbo]. [Customer] Script Date: 04/06/2009 06: 55: 14 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo]. [Customer] (

[Name_organiz] [varchar] (30) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Activities] [varchar] (50) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Address] [varchar] (50) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Telephone] [varchar] (50) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[E_mail] [varchar] (50) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Site] [varchar] (50) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Contact] [varchar] (50) COLLATE SQL_SwedishStd_Pref_CP1_CI_AS NULL,

[Info] [varchar] (150) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Id_manager] [int] NULL,

[Id_status] [int] NULL,

[Id_customer] [int] IDENTITY(1,1) NOT NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

USE [simpaza]

GO

/ ****** Object: Table [dbo]. [Call] Script Date: 04/06/2009 06: 55: 29 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo]. [Call] (

[Date] [datetime] NULL,

[Id_customer] [int] NULL,

[Comments] [varchar] (150) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Id_call] [int] IDENTITY(1,1) NOT NULL,

[Id_manager] [int] NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

USE [simpaza]

GO

/ ****** Object: Table [dbo]. [Meeting] Script Date: 04/06/2009 06: 55: 41 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo]. [Meeting] (

[Date] [datetime] NULL,

[Id_customer] [int] NULL,

[Comments] [varchar] (150) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Place] [varchar] (50) COLLATE SQL_Ukrainian_CP1251_CI_AS NULL,

[Id_meeting] [int] IDENTITY(1,1) NOT NULL,

[Id_manager] [int] NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

USE [simpaza]

GO

/ ****** Object: View [dbo]. [Customer_Status] Script Date: 04/06/2009 06: 37: 20 ****** /

SET ANSI_NULLS OFF

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE VIEW [dbo]. [Customer_Status]

WITH VIEW_METADATA

AS

SELECT dbo. Status. Status, dbo. Customer. Id_customer, dbo. Customer. Name_organiz, dbo. Customer. Activities, dbo. Customer. Address,

dbo. Customer. Telephone, dbo. Customer. E_mail, dbo. Customer. Site, dbo. Customer. Contact, dbo. Customer. Info, dbo. Customer. Id_manager,

dbo. Customer. Id_status

FROM dbo. Customer LEFT OUTER JOIN

dbo. Status ON dbo. Customer. Id_status = dbo. Status. Id_status

GO

EXEC sys. sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N' [0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]

Begin DesignProperties =

Begin PaneConfigurations =

Begin PaneConfiguration = 0

NumPanes = 4

Configuration = "(H (1 [41] 4 [33] 2 [8] 3))"

End

Begin PaneConfiguration = 1

NumPanes = 3

Configuration = "(H (1 [50] 4 [25] 3))"

End

Begin PaneConfiguration = 2

NumPanes = 3

Configuration = "(H (1 [50] 2 [25] 3))"

End

Begin PaneConfiguration = 3

NumPanes = 3

Configuration = "(H (4 [30] 2 [40] 3))"

End

Begin PaneConfiguration = 4

NumPanes = 2

Configuration = "(H (1 [56] 3))"

End

Begin PaneConfiguration = 5

NumPanes = 2

Configuration = "(H (2 [66] 3))"

End

Begin PaneConfiguration = 6

NumPanes = 2

Configuration = "(H (4 [50] 3))"

End

Begin PaneConfiguration = 7

NumPanes = 1

Configuration = "(V (3))"

End

Begin PaneConfiguration = 8

NumPanes = 3

Configuration = "(H (1 [56] 4 [18] 2))"

End

Begin PaneConfiguration = 9

NumPanes = 2

Configuration = "(H (1 [75] 4))"

End

Begin PaneConfiguration = 10

NumPanes = 2

Configuration = "(H (1 [66] 2))"

End

Begin PaneConfiguration = 11

NumPanes = 2

Configuration = "(H (4 [60] 2))"

End

Begin PaneConfiguration = 12

NumPanes = 1

Configuration = "(H (1))"

End

Begin PaneConfiguration = 13

NumPanes = 1

Configuration = "(V (4))"

End

Begin PaneConfiguration = 14

NumPanes = 1

Configuration = "(V (2))"

End

ActivePaneConfig = 0

End

Begin DiagramPane =

Begin Origin =

Top = 0

Left = 0

End

Begin Tables =

Begin Table = "Customer"

Begin Extent =

Top = 6

Left = 38

Bottom = 114

Right = 189

End

DisplayFlags = 280

TopColumn = 0

End

Begin Table = "Status"

Begin Extent =

Top = 6

Left = 227

Bottom = 84

Right = 378

End

DisplayFlags = 280

TopColumn = 0

End

End

End

Begin SQLPane =

End

Begin DataPane =

Begin ParameterDefaults = ""

End

End

Begin CriteriaPane =

Begin ColumnWidths = 11

Column = 1440

Alias = 900

Table = 1170

Output = 720

Append = 1400

NewValue = 1170

SortType = 1350

SortOrder = 1410

GroupBy = 1350

Filter = 1350

Or = 1350

Or = 1350

Or = 1350

End

End

End

',@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'VIEW', @level1name=N'Customer_Status'

GO

EXEC sys. sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'VIEW', @level1name=N'Customer_Status'

USE [simpaza]

GO

/ ****** Object: View [dbo]. [Calls] Script Date: 04/06/2009 06: 37: 32 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE VIEW [dbo]. [Calls]

WITH VIEW_METADATA

AS

SELECT dbo. Customer. Id_customer AS Expr1, dbo. Customer. Name_organiz, dbo. Call. Id_call, dbo. Call. Date, dbo. Call. Id_customer, dbo. Call. Comments,

dbo. Customer. Id_manager

FROM dbo. Call INNER JOIN

dbo. Customer ON dbo. Call. Id_customer = dbo. Customer. Id_customer

GO

EXEC sys. sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N' [0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]

Begin DesignProperties =

Begin PaneConfigurations =

Begin PaneConfiguration = 0

NumPanes = 4

Configuration = "(H (1 [41] 4 [47] 2 [5] 3))"

End

Begin PaneConfiguration = 1

NumPanes = 3

Configuration = "(H (1 [50] 4 [25] 3))"

End

Begin PaneConfiguration = 2

NumPanes = 3

Configuration = "(H (1 [50] 2 [25] 3))"

End

Begin PaneConfiguration = 3

NumPanes = 3

Configuration = "(H (4 [30] 2 [40] 3))"

End

Begin PaneConfiguration = 4

NumPanes = 2

Configuration = "(H (1 [56] 3))"

End

Begin PaneConfiguration = 5

NumPanes = 2

Configuration = "(H (2 [66] 3))"

End

Begin PaneConfiguration = 6

NumPanes = 2

Configuration = "(H (4 [50] 3))"

End

Begin PaneConfiguration = 7

NumPanes = 1

Configuration = "(V (3))"

End

Begin PaneConfiguration = 8

NumPanes = 3

Configuration = "(H (1 [56] 4 [18] 2))"

End

Begin PaneConfiguration = 9

NumPanes = 2

Configuration = "(H (1 [75] 4))"

End

Begin PaneConfiguration = 10

NumPanes = 2

Configuration = "(H (1 [66] 2))"

End

Begin PaneConfiguration = 11

NumPanes = 2

Configuration = "(H (4 [60] 2))"

End

Begin PaneConfiguration = 12

NumPanes = 1

Configuration = "(H (1))"

End

Begin PaneConfiguration = 13

NumPanes = 1

Configuration = "(V (4))"

End

Begin PaneConfiguration = 14

NumPanes = 1

Configuration = "(V (2))"

End

ActivePaneConfig = 0

End

Begin DiagramPane =

Begin Origin =

Top = 0

Left = 0

End

Begin Tables =

Begin Table = "Call"

Begin Extent =

Top = 6

Left = 38

Bottom = 160

Right = 189

End

DisplayFlags = 280

TopColumn = 1

End

Begin Table = "Customer"

Begin Extent =

Top = 6

Left = 227

Bottom = 114

Right = 378

End

DisplayFlags = 280

TopColumn = 7

End

End

End

Begin SQLPane =

End

Begin DataPane =

Begin ParameterDefaults = ""

End

Begin ColumnWidths = 9

Width = 284

Width = 1500

Width = 1500

Width = 1500

Width = 1500

Width = 1500

Width = 1500

Width = 1500

Width = 1500

End

End

Begin CriteriaPane =

Begin ColumnWidths = 11

Column = 1440

Alias = 900

Table = 1170

Output = 720

Append = 1400

NewValue = 1170

SortType = 1350

SortOrder = 1410

GroupBy = 1350

Filter = 1350

Or = 1350

Or = 1350

Or = 1350

End

End

End

',@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'VIEW', @level1name=N'Calls'

GO

EXEC sys. sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'VIEW', @level1name=N'Calls'

USE [simpaza]

GO

/ ****** Object: View [dbo]. [Meetings] Script Date: 04/06/2009 06: 37: 44 ****** /

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE VIEW [dbo]. [Meetings]

WITH VIEW_METADATA

AS

SELECT dbo. Customer. Id_customer AS Expr1, dbo. Customer. Name_organiz, dbo. Meeting. Date, dbo. Meeting. Comments, dbo. Meeting. Place,

dbo. Meeting. Id_meeting, dbo. Meeting. Id_customer, dbo. Customer. Id_manager

FROM dbo. Meeting INNER JOIN

dbo. Customer ON dbo. Meeting. Id_customer = dbo. Customer. Id_customer

WITH CHECK OPTION

GO

EXEC sys. sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N' [0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]

Begin DesignProperties =

Begin PaneConfigurations =

Begin PaneConfiguration = 0

NumPanes = 4

Configuration = "(H (1 [32] 4 [51] 2 [1] 3))"

End

Begin PaneConfiguration = 1

NumPanes = 3

Configuration = "(H (1 [50] 4 [25] 3))"

End

Begin PaneConfiguration = 2

NumPanes = 3

Configuration = "(H (1 [50] 2 [25] 3))"

End

Begin PaneConfiguration = 3

NumPanes = 3

Configuration = "(H (4 [30] 2 [40] 3))"

End

Begin PaneConfiguration = 4

NumPanes = 2

Configuration = "(H (1 [56] 3))"

End

Begin PaneConfiguration = 5

NumPanes = 2

Configuration = "(H (2 [66] 3))"

End

Begin PaneConfiguration = 6

NumPanes = 2

Configuration = "(H (4 [50] 3))"

End

Begin PaneConfiguration = 7

NumPanes = 1

Configuration = "(V (3))"

End

Begin PaneConfiguration = 8

NumPanes = 3

Configuration = "(H (1 [56] 4 [18] 2))"

End

Begin PaneConfiguration = 9

NumPanes = 2

Configuration = "(H (1 [75] 4))"

End

Begin PaneConfiguration = 10

NumPanes = 2

Configuration = "(H (1 [66] 2))"

End

Begin PaneConfiguration = 11

NumPanes = 2

Configuration = "(H (4 [60] 2))"

End

Begin PaneConfiguration = 12

NumPanes = 1

Configuration = "(H (1))"

End

Begin PaneConfiguration = 13

NumPanes = 1

Configuration = "(V (4))"