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.

336 lines
11 KiB

  1. /****** Object: Table [dbo].[OSSKUs] Script Date: 5/24/2002 4:11:37 PM ******/
  2. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OSSKUs]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  3. drop table [dbo].[OSSKUs]
  4. GO
  5. /****** Object: Table [dbo].[BucketCounts] Script Date: 5/17/2002 4:24:59 PM ******/
  6. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BucketCounts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  7. drop table [dbo].[BucketCounts]
  8. GO
  9. /****** Object: Table [dbo].[BucketToInt] Script Date: 5/17/2002 4:24:59 PM ******/
  10. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BucketToInt]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  11. drop table [dbo].[BucketToInt]
  12. GO
  13. /****** Object: Table [dbo].[CrashInstances] Script Date: 5/17/2002 4:24:59 PM ******/
  14. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CrashInstances]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  15. drop table [dbo].[CrashInstances]
  16. GO
  17. /****** Object: Table [dbo].[DrNames] Script Date: 5/17/2002 4:24:59 PM ******/
  18. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DrNames]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  19. drop table [dbo].[DrNames]
  20. GO
  21. /****** Object: Table [dbo].[FollowupGroup] Script Date: 5/17/2002 4:24:59 PM ******/
  22. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FollowupGroup]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  23. drop table [dbo].[FollowupGroup]
  24. GO
  25. /****** Object: Table [dbo].[FollowupIds] Script Date: 5/17/2002 4:24:59 PM ******/
  26. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FollowupIds]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  27. drop table [dbo].[FollowupIds]
  28. GO
  29. /****** Object: Table [dbo].[FilePath] Script Date: 7/11/2002 23:23:17 ******/
  30. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FilePath]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  31. drop table [dbo].[FilePath]
  32. GO
  33. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PssSR]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  34. drop table [dbo].[PssSR]
  35. GO
  36. /****** Object: Login OcaDebug Script Date: 2002/06/20 13:45:42 ******/
  37. if not exists (select * from master.dbo.syslogins where loginname = N'OcaDebug')
  38. BEGIN
  39. declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'CrashDB3', @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'OcaDebug', null, @logindb, @loginlang
  45. END
  46. GO
  47. /****** Object: Login Web_RO Script Date: 2002/06/20 13:45:42 ******/
  48. if not exists (select * from master.dbo.syslogins where loginname = N'Web_RO')
  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_RO', null, @logindb, @loginlang
  56. END
  57. GO
  58. /****** Object: Login WEB_RW Script Date: 2002/06/20 13:45:42 ******/
  59. if not exists (select * from master.dbo.syslogins where loginname = N'WEB_RW')
  60. BEGIN
  61. declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'master', @loginlang = N'us_english'
  62. if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
  63. select @logindb = N'master'
  64. if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
  65. select @loginlang = @@language
  66. exec sp_addlogin N'WEB_RW', null, @logindb, @loginlang
  67. END
  68. GO
  69. /****** Object: User OcaDebug Script Date: 2002/06/20 13:45:42 ******/
  70. if not exists (select * from dbo.sysusers where name = N'OcaDebug' and uid < 16382)
  71. EXEC sp_grantdbaccess N'OcaDebug', N'OcaDebug'
  72. GO
  73. /****** Object: User Web_RO Script Date: 2002/06/20 13:45:42 ******/
  74. if not exists (select * from dbo.sysusers where name = N'Web_RO' and uid < 16382)
  75. EXEC sp_grantdbaccess N'Web_RO', N'Web_RO'
  76. GO
  77. /****** Object: User WEB_RW Script Date: 2002/06/20 13:45:42 ******/
  78. if not exists (select * from dbo.sysusers where name = N'WEB_RW' and uid < 16382)
  79. EXEC sp_grantdbaccess N'WEB_RW', N'WEB_RW'
  80. GO
  81. /****** Object: User OcaDebug Script Date: 2002/06/20 13:45:42 ******/
  82. exec sp_addrolemember N'db_datareader', N'OcaDebug'
  83. GO
  84. /****** Object: User Web_RO Script Date: 2002/06/20 13:45:42 ******/
  85. exec sp_addrolemember N'db_datareader', N'Web_RO'
  86. GO
  87. /****** Object: User WEB_RW Script Date: 2002/06/20 13:45:42 ******/
  88. exec sp_addrolemember N'db_datareader', N'WEB_RW'
  89. GO
  90. /****** Object: User OcaDebug Script Date: 2002/06/20 13:45:42 ******/
  91. exec sp_addrolemember N'db_datawriter', N'OcaDebug'
  92. GO
  93. /****** Object: User WEB_RW Script Date: 2002/06/20 13:45:42 ******/
  94. exec sp_addrolemember N'db_datawriter', N'WEB_RW'
  95. GO
  96. /****** Object: User Web_RO Script Date: 2002/06/20 13:45:42 ******/
  97. exec sp_addrolemember N'db_denydatawriter', N'Web_RO'
  98. GO
  99. /****** Object: Table [dbo].[BucketCounts] Script Date: 5/24/2002 4:04:40 PM ******/
  100. CREATE TABLE [dbo].[BucketCounts] (
  101. [HitCount] [int] NULL ,
  102. [BuildNo] [int] NULL ,
  103. [HitDate] [datetime] NULL ,
  104. [BucketID] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  105. ) ON [PRIMARY]
  106. GO
  107. /****** Object: Table [dbo].[OSSKUs] Script Date: 5/24/2002 4:11:37 PM ******/
  108. CREATE TABLE [dbo].[OSSKUs] (
  109. [SKUId] [smallint] NOT NULL ,
  110. [SKUDescription] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  111. ) ON [PRIMARY]
  112. GO
  113. INSERT INTO OSSKUs( skuID, SKUdescription ) VALUES ( 0, 'Home Edition' )
  114. GO
  115. INSERT INTO OSSKUs( skuID, SKUdescription ) VALUES ( 1, 'Professional' )
  116. GO
  117. INSERT INTO OSSKUs( skuID, SKUdescription ) VALUES ( 2, 'Server' )
  118. GO
  119. INSERT INTO OSSKUs( skuID, SKUdescription ) VALUES ( 3, 'Advanced Server' )
  120. GO
  121. INSERT INTO OSSKUs( skuID, SKUdescription ) VALUES ( 4, 'Web Server' )
  122. GO
  123. INSERT INTO OSSKUs( skuID, SKUdescription ) VALUES ( 5, 'Data Center' )
  124. GO
  125. /****** Object: Table [dbo].[BucketToInt] Script Date: 5/17/2002 4:25:02 PM ******/
  126. CREATE TABLE [dbo].[BucketToInt] (
  127. [BucketId] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  128. [iBucket] [int] IDENTITY (100, 1) NOT NULL ,
  129. [iFollowup] [int] NULL ,
  130. [iDriverName] [int] NULL ,
  131. [PoolCorruption] [bit] NULL ,
  132. [Platform] [int] NULL ,
  133. [MoreData] [bigint] NULL
  134. ) ON [PRIMARY]
  135. GO
  136. /****** Object: Table [dbo].[CrashInstances] Script Date: 5/17/2002 4:25:02 PM ******/
  137. CREATE TABLE [dbo].[CrashInstances] (
  138. [bFullDump] [tinyint] NULL ,
  139. [SKU] [tinyint] NULL ,
  140. [Source] [tinyint] NULL ,
  141. [OEMId] [smallint] NULL ,
  142. [BuildNo] [int] NOT NULL ,
  143. [sBucket] [int] NOT NULL ,
  144. [gBucket] [int] NOT NULL ,
  145. [Uptime] [int] NULL ,
  146. [CpuId] [bigint] NOT NULL ,
  147. [EntryDate] [datetime] NOT NULL ,
  148. [Guid] [uniqueidentifier] NOT NULL
  149. ) ON [PRIMARY]
  150. GO
  151. /****** Object: Table [dbo].[DrNames] Script Date: 5/17/2002 4:25:02 PM ******/
  152. CREATE TABLE [dbo].[DrNames] (
  153. [iDriverName] [int] IDENTITY (1, 1) NOT NULL ,
  154. [DriverName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  155. ) ON [PRIMARY]
  156. GO
  157. /****** Object: Table [dbo].[FollowupGroup] Script Date: 5/17/2002 4:25:03 PM ******/
  158. CREATE TABLE [dbo].[FollowupGroup] (
  159. [iGroup] [int] IDENTITY (1, 1) NOT NULL ,
  160. [GroupName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  161. ) ON [PRIMARY]
  162. GO
  163. /****** Object: Table [dbo].[FollowupIds] Script Date: 5/17/2002 4:25:03 PM ******/
  164. CREATE TABLE [dbo].[FollowupIds] (
  165. [iFollowup] [int] IDENTITY (1, 1) NOT NULL ,
  166. [iGroup] [int] NULL ,
  167. [Followup] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  168. ) ON [PRIMARY]
  169. GO
  170. /****** Object: Table [dbo].[FilePath] Script Date: 7/29/2002 05:21:57 PM ******/
  171. CREATE TABLE [dbo].[FilePath] (
  172. [FPIndex] [int] IDENTITY (1, 1) NOT NULL ,
  173. [Guid] [uniqueidentifier] NOT NULL ,
  174. [FilePath] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  175. ) ON [PRIMARY]
  176. GO
  177. CREATE TABLE [dbo].[PssSR] (
  178. [SR] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  179. [CrashGUID] [uniqueidentifier] NULL
  180. ) ON [PRIMARY]
  181. GO
  182. CREATE CLUSTERED INDEX [IX_FilePath] ON [dbo].[FilePath]([Guid]) ON [PRIMARY]
  183. GO
  184. ALTER TABLE [dbo].[FilePath] WITH NOCHECK ADD
  185. CONSTRAINT [PK_FilePath] PRIMARY KEY NONCLUSTERED
  186. (
  187. [FPIndex]
  188. ) ON [PRIMARY]
  189. GO
  190. ALTER TABLE [dbo].[BucketToInt] WITH NOCHECK ADD
  191. CONSTRAINT [PK_BucketToInt] PRIMARY KEY CLUSTERED
  192. (
  193. [BucketId]
  194. ) ON [PRIMARY]
  195. GO
  196. ALTER TABLE [dbo].[DrNames] WITH NOCHECK ADD
  197. CONSTRAINT [PK_DrNames] PRIMARY KEY CLUSTERED
  198. (
  199. [DriverName]
  200. ) ON [PRIMARY]
  201. GO
  202. ALTER TABLE [dbo].[FollowupGroup] WITH NOCHECK ADD
  203. PRIMARY KEY CLUSTERED
  204. (
  205. [GroupName]
  206. ) ON [PRIMARY]
  207. GO
  208. ALTER TABLE [dbo].[FollowupIds] WITH NOCHECK ADD
  209. CONSTRAINT [PK__FollowupIds__7F2BE32F] PRIMARY KEY CLUSTERED
  210. (
  211. [Followup]
  212. ) ON [PRIMARY]
  213. GO
  214. CREATE INDEX [IX_CrashInstances2] ON [dbo].[CrashInstances]([EntryDate]) ON [PRIMARY]
  215. GO
  216. CREATE CLUSTERED INDEX [IX_BucketCounts] ON [dbo].[BucketCounts]([BucketID], [BuildNo], [HitDate]) ON [PRIMARY]
  217. GO
  218. ALTER TABLE [dbo].[CrashInstances] WITH NOCHECK ADD
  219. CONSTRAINT [PK_CrashInstances2] PRIMARY KEY CLUSTERED
  220. (
  221. [Guid]
  222. ) ON [PRIMARY]
  223. GO
  224. ALTER TABLE [dbo].[CrashInstances] WITH NOCHECK ADD
  225. CONSTRAINT [DF__CrashInst__Sourc__02FC7413] DEFAULT (1) FOR [Source]
  226. GO
  227. ALTER TABLE [dbo].[BucketToInt] WITH NOCHECK ADD
  228. CONSTRAINT [UQ__BucketToInt__0B91BA14] UNIQUE NONCLUSTERED
  229. (
  230. [iBucket]
  231. ) ON [PRIMARY]
  232. GO
  233. CREATE INDEX [IX_DrNames] ON [dbo].[DrNames]([DriverName], [iDriverName]) ON [PRIMARY]
  234. GO
  235. ALTER TABLE [dbo].[OSSKUs] WITH NOCHECK ADD
  236. CONSTRAINT [PK_OSSKUs] PRIMARY KEY CLUSTERED
  237. (
  238. [SKUId]
  239. ) ON [PRIMARY]
  240. GO
  241. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[BucketCounts] TO [OcaDebug]
  242. GO
  243. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[BucketToInt] TO [OcaDebug]
  244. GO
  245. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[CrashInstances] TO [OcaDebug]
  246. GO
  247. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[DrNames] TO [OcaDebug]
  248. GO
  249. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[FollowupGroup] TO [OcaDebug]
  250. GO
  251. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[FollowupIds] TO [OcaDebug]
  252. GO
  253. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[OSSKUs] TO [OcaDebug]
  254. GO
  255. GRANT SELECT , UPDATE , INSERT , DELETE ON [dbo].[PssSR] TO [OcaDebug]
  256. GO