Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

254 lines
10 KiB

  1. /****** Object: Table [dbo].[Customer] Script Date: 5/17/2002 4:41:57 PM ******/
  2. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Customer]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  3. drop table [dbo].[Customer]
  4. GO
  5. /****** Object: Table [dbo].[Incident] Script Date: 5/17/2002 4:41:57 PM ******/
  6. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Incident]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  7. drop table [dbo].[Incident]
  8. GO
  9. /****** Object: Table [dbo].[MailResponse] Script Date: 5/17/2002 4:41:57 PM ******/
  10. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MailResponse]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  11. drop table [dbo].[MailResponse]
  12. GO
  13. /****** Object: Table [dbo].[Response] Script Date: 5/17/2002 4:41:57 PM ******/
  14. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Response]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  15. drop table [dbo].[Response]
  16. GO
  17. /****** Object: Table [dbo].[SurveyResults] Script Date: 5/17/2002 4:41:57 PM ******/
  18. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SurveyResults]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  19. drop table [dbo].[SurveyResults]
  20. GO
  21. /****** Object: Table [dbo].[Trans] Script Date: 5/17/2002 4:41:57 PM ******/
  22. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Trans]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  23. drop table [dbo].[Trans]
  24. GO
  25. /****** Object: Login OcaDebug Script Date: 2002/06/20 13:52:26 ******/
  26. if not exists (select * from master.dbo.syslogins where loginname = N'OcaDebug')
  27. BEGIN
  28. declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'CrashDB3', @loginlang = N'us_english'
  29. if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
  30. select @logindb = N'master'
  31. if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
  32. select @loginlang = @@language
  33. exec sp_addlogin N'OcaDebug', null, @logindb, @loginlang
  34. END
  35. GO
  36. /****** Object: Login Web_RO Script Date: 2002/06/20 13:52:26 ******/
  37. if not exists (select * from master.dbo.syslogins where loginname = N'Web_RO')
  38. BEGIN
  39. declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'master', @loginlang = N'us_english'
  40. if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
  41. select @logindb = N'master'
  42. if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
  43. select @loginlang = @@language
  44. exec sp_addlogin N'Web_RO', null, @logindb, @loginlang
  45. END
  46. GO
  47. /****** Object: Login WEB_RW Script Date: 2002/06/20 13:52:26 ******/
  48. if not exists (select * from master.dbo.syslogins where loginname = N'WEB_RW')
  49. BEGIN
  50. declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'master', @loginlang = N'us_english'
  51. if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
  52. select @logindb = N'master'
  53. if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
  54. select @loginlang = @@language
  55. exec sp_addlogin N'WEB_RW', null, @logindb, @loginlang
  56. END
  57. GO
  58. /****** Object: User Web_RO Script Date: 2002/06/20 13:52:26 ******/
  59. if not exists (select * from dbo.sysusers where name = N'Web_RO' and uid < 16382)
  60. EXEC sp_grantdbaccess N'Web_RO', N'Web_RO'
  61. GO
  62. /****** Object: User WEB_RW Script Date: 2002/06/20 13:52:26 ******/
  63. if not exists (select * from dbo.sysusers where name = N'WEB_RW' and uid < 16382)
  64. EXEC sp_grantdbaccess N'WEB_RW', N'WEB_RW'
  65. GO
  66. /****** Object: User Web_RO Script Date: 2002/06/20 13:52:26 ******/
  67. exec sp_addrolemember N'db_datareader', N'Web_RO'
  68. GO
  69. /****** Object: User WEB_RW Script Date: 2002/06/20 13:52:26 ******/
  70. exec sp_addrolemember N'db_datareader', N'WEB_RW'
  71. GO
  72. /****** Object: User WEB_RW Script Date: 2002/06/20 13:52:26 ******/
  73. exec sp_addrolemember N'db_datawriter', N'WEB_RW'
  74. GO
  75. /****** Object: User Web_RO Script Date: 2002/06/20 13:52:26 ******/
  76. exec sp_addrolemember N'db_denydatawriter', N'Web_RO'
  77. GO
  78. /****** Object: Table [dbo].[Customer] Script Date: 5/17/2002 4:41:59 PM ******/
  79. CREATE TABLE [dbo].[Customer] (
  80. [CustomerId] [int] IDENTITY (1, 1) NOT NULL ,
  81. [Lang] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  82. [PassportID] [bigint] NOT NULL ,
  83. [Email] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  84. ) ON [PRIMARY]
  85. GO
  86. /****** Object: Table [dbo].[Incident] Script Date: 5/17/2002 4:41:59 PM ******/
  87. CREATE TABLE [dbo].[Incident] (
  88. [CustomerID] [int] NOT NULL ,
  89. [TrackID] [int] IDENTITY (100000, 1) NOT NULL ,
  90. [sBucket] [int] NULL ,
  91. [gBucket] [int] NULL ,
  92. [Created] [datetime] NULL ,
  93. [GUID] [uniqueidentifier] NULL ,
  94. [Description] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  95. ) ON [PRIMARY]
  96. GO
  97. /****** Object: Table [dbo].[MailResponse] Script Date: 5/17/2002 4:41:59 PM ******/
  98. CREATE TABLE [dbo].[MailResponse] (
  99. [CustomerID] [int] NOT NULL ,
  100. [ResponseType] [int] NOT NULL ,
  101. [sbucket] [int] NOT NULL
  102. ) ON [PRIMARY]
  103. GO
  104. /****** Object: Table [dbo].[Response] Script Date: 5/17/2002 4:42:00 PM ******/
  105. CREATE TABLE [dbo].[Response] (
  106. [Type] [smallint] NOT NULL ,
  107. [Lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  108. [Subject] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  109. [Description] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  110. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  111. GO
  112. /****** Object: Table [dbo].[SurveyResults] Script Date: 5/17/2002 4:42:00 PM ******/
  113. CREATE TABLE [dbo].[SurveyResults] (
  114. [bHelped] [bit] NULL ,
  115. [bUnderstand] [bit] NULL ,
  116. [SolutionID] [int] NOT NULL ,
  117. [Comment] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  118. ) ON [PRIMARY]
  119. GO
  120. /****** Object: Table [dbo].[Trans] Script Date: 5/17/2002 4:42:00 PM ******/
  121. CREATE TABLE [dbo].[Trans] (
  122. [Type] [tinyint] NULL ,
  123. [Status] [smallint] NULL ,
  124. [TransactionID] [int] IDENTITY (1, 1) NOT NULL ,
  125. [CustomerID] [int] NOT NULL ,
  126. [FileCount] [int] NULL ,
  127. [TransDate] [datetime] NULL ,
  128. [Description] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  129. ) ON [PRIMARY]
  130. GO
  131. CREATE UNIQUE CLUSTERED INDEX [IX_Customer] ON [dbo].[Customer]([PassportID]) ON [PRIMARY]
  132. GO
  133. CREATE CLUSTERED INDEX [IX_Incident] ON [dbo].[Incident]([CustomerID]) ON [PRIMARY]
  134. GO
  135. CREATE CLUSTERED INDEX [IX_SurveyResults] ON [dbo].[SurveyResults]([SolutionID]) ON [PRIMARY]
  136. GO
  137. CREATE INDEX [IDX_sBucket] ON [dbo].[Incident]([sBucket]) ON [PRIMARY]
  138. GO
  139. /****** Object: Table [dbo].[ReproSteps] Script Date: 2002/06/04 13:01:30 ******/
  140. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ReproSteps]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  141. drop table [dbo].[ReproSteps]
  142. GO
  143. /****** Object: Table [dbo].[ReproSteps] Script Date: 2002/06/04 13:01:33 ******/
  144. CREATE TABLE [dbo].[ReproSteps] (
  145. [iIdentity] [int] IDENTITY (1, 1) NOT NULL ,
  146. [BucketID] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  147. [ReproSteps] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  148. ) ON [PRIMARY]
  149. GO
  150. CREATE CLUSTERED INDEX [IX_ReproSteps] ON [dbo].[ReproSteps]([BucketID]) ON [PRIMARY]
  151. GO
  152. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'Customer', N'column', N'CustomerId'
  153. GO
  154. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'Customer', N'column', N'CustomerId'
  155. GO
  156. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'Customer', N'column', N'CustomerId'
  157. GO
  158. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'Incident', N'column', N'CustomerID'
  159. GO
  160. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'Incident', N'column', N'CustomerID'
  161. GO
  162. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'Incident', N'column', N'CustomerID'
  163. GO
  164. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'MailResponse', N'column', N'CustomerID'
  165. GO
  166. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'MailResponse', N'column', N'CustomerID'
  167. GO
  168. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'MailResponse', N'column', N'CustomerID'
  169. GO
  170. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'MailResponse', N'column', N'ResponseType'
  171. GO
  172. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'MailResponse', N'column', N'ResponseType'
  173. GO
  174. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'MailResponse', N'column', N'ResponseType'
  175. GO
  176. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'MailResponse', N'column', N'sbucket'
  177. GO
  178. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'MailResponse', N'column', N'sbucket'
  179. GO
  180. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'MailResponse', N'column', N'sbucket'
  181. GO
  182. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'SurveyResults', N'column', N'Comment'
  183. GO
  184. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'SurveyResults', N'column', N'Comment'
  185. GO
  186. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'SurveyResults', N'column', N'Comment'
  187. GO
  188. exec sp_addextendedproperty N'MS_DisplayControl', N'109', N'user', N'dbo', N'table', N'SurveyResults', N'column', N'SolutionID'
  189. GO
  190. exec sp_addextendedproperty N'MS_Format', null, N'user', N'dbo', N'table', N'SurveyResults', N'column', N'SolutionID'
  191. GO
  192. exec sp_addextendedproperty N'MS_IMEMode', N'0', N'user', N'dbo', N'table', N'SurveyResults', N'column', N'SolutionID'
  193. GO
  194. GRANT SELECT ON [dbo].[Customer] TO [Web_RO]
  195. GO
  196. GRANT SELECT ON [dbo].[Incident] TO [Web_RO]
  197. GO