123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
-
- use [db]
- go
- set ansi_nulls on
- go
- set quoted_identifier on
- go
- set ansi_padding on
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'SurveyObject') and objectproperty(id,'IsTable') = 1)
- begin
- create table [dbo].[SurveyObject](
- [ObjID] [int] identity(1,1) not null,
- [SvrKind] [tinyint] not null,
-
- constraint [PK_SurveyObject] primary key clustered
- (
- [ObjID] asc
- ) with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off,allow_row_locks = on,allow_page_locks = on) on [primary],
-
- constraint [UK_SurveyObject] unique nonclustered
- (
- [SvrKind] asc
- ) with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off,allow_row_locks = on,allow_page_locks = on) on [primary]
- ) on [primary]
- end
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'SatisfactionSvrKind') and objectproperty(id,'IsTable') = 1)
- begin
- create table [dbo].[SatisfactionSvrKind](
- [SvrKind] [tinyint] identity(1,1) not null,
-
- [KindName] [nvarchar](24) not null,
- [KindDesc] [nvarchar](512) null,
-
-
- constraint [PK_SatisfactionSvrKind] primary key clustered
- (
- [SvrKind] asc
- ) with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off,allow_row_locks = on,allow_page_locks = on) on [primary]
- ) on [primary]
- end
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'SatisfactionCfg') and objectproperty(id,'IsTable') = 1)
- begin
- CREATE TABLE [dbo].[SatisfactionCfg](
- [cfgID] [int] IDENTITY(1,1) NOT NULL,
- [SvrKind] [tinyint] NOT NULL,
-
- [KindName] [nvarchar](24) NOT NULL,
- [MaxScore] [tinyint] NOT NULL DEFAULT ((1)),
- [TypeID] [tinyint] NOT NULL DEFAULT ((1)),
- [IsEnable] [tinyint] NOT NULL DEFAULT ((1)),
- [sfncfgDesc] [nvarchar](512) NULL,
- CONSTRAINT [PK_SatisfactionCfg] PRIMARY KEY CLUSTERED
- (
- [cfgID] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- end
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'SatisfactionScoreType') and objectproperty(id,'IsTable') = 1)
- begin
- CREATE TABLE [dbo].[SatisfactionScoreType](
- [TypeID] [tinyint] IDENTITY(1,1) NOT NULL,
- [TypeName] [nvarchar](16) NOT NULL,
- [Section1] [tinyint] NOT NULL DEFAULT ((0)),
- [Section2] [tinyint] NOT NULL DEFAULT ((0)),
- [Section3] [tinyint] NOT NULL DEFAULT ((0)),
- [Section4] [tinyint] NOT NULL DEFAULT ((0)),
- [Section5] [tinyint] NOT NULL DEFAULT ((0)),
-
- CONSTRAINT [PK_SatisfactionScoreType] PRIMARY KEY CLUSTERED
- (
- [TypeID] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- end
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'SatisfactionSurvey') and objectproperty(id,'IsTable') = 1)
- begin
- CREATE TABLE [dbo].[SatisfactionSurvey](
- [SurveyLogID] [int] IDENTITY(1,1) NOT NULL,
- [cfgID] [int] NOT NULL,
- [ObjID] [nvarchar](50) NOT NULL,
- [ObjName] [nvarchar](50) NOT NULL,
- [OrderID] [nvarchar](50) NOT NULL,
- [Score] [int] NOT NULL,
- [State] [nvarchar](24) NOT NULL,
- [SurveyTime] [nvarchar](24) NULL,
- [SurveyCS] [nvarchar](24) NULL,
- CONSTRAINT [PK_SatisfactionSurvey] PRIMARY KEY CLUSTERED
- (
- [SurveyLogID] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
- CONSTRAINT [UK_SatisfactionSurvey] UNIQUE NONCLUSTERED
- (
- [SurveyLogID] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- end
- go
- set ansi_padding off
|