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.

203 lines
6.7 KiB

  1. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Customer]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  2. drop table [dbo].[Customer]
  3. GO
  4. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DriverList]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  5. drop table [dbo].[DriverList]
  6. GO
  7. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Drivers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  8. drop table [dbo].[Drivers]
  9. GO
  10. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Incident]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  11. drop table [dbo].[Incident]
  12. GO
  13. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MailIncidents]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  14. drop table [dbo].[MailIncidents]
  15. GO
  16. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MailTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  17. drop table [dbo].[MailTable]
  18. GO
  19. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Resources]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  20. drop table [dbo].[Resources]
  21. GO
  22. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Response]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  23. drop table [dbo].[Response]
  24. GO
  25. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Trans]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  26. drop table [dbo].[Trans]
  27. GO
  28. CREATE TABLE [dbo].[Customer] (
  29. [HighID] [int] NOT NULL ,
  30. [LowID] [int] NOT NULL ,
  31. [EMail] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  32. [Contact] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  33. [Phone] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  34. [Lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  35. [PremierID] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  36. ) ON [PRIMARY]
  37. GO
  38. CREATE TABLE [dbo].[DriverList] (
  39. [DriverID] [int] NULL ,
  40. [IncidentID] [int] NULL
  41. ) ON [PRIMARY]
  42. GO
  43. CREATE TABLE [dbo].[Drivers] (
  44. [DriverID] [int] IDENTITY (1, 1) NOT NULL ,
  45. [Filename] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  46. [CreateDate] [datetime] NOT NULL ,
  47. [Version] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  48. [FileSize] [int] NULL ,
  49. [Manufacturer] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  50. [ProductName] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  51. ) ON [PRIMARY]
  52. GO
  53. CREATE TABLE [dbo].[Incident] (
  54. [HighID] [int] NULL ,
  55. [LowID] [int] NULL ,
  56. [IncidentID] [int] IDENTITY (0, 1) NOT NULL ,
  57. [DumpHash] [binary] (16) NULL ,
  58. [Created] [datetime] NULL ,
  59. [ClassID] [int] NULL ,
  60. [InstanceID] [int] NULL ,
  61. [TransactionID] [int] NULL ,
  62. [Path] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  63. [Display] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  64. [ComputerName] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  65. [OSName] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  66. [OSVersion] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  67. [OSLang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  68. [Description] [nvarchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  69. [Repro] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  70. [Comments] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  71. [Filter] [tinyint] NULL ,
  72. [Message] [smallint] NULL ,
  73. [SendMail] [smallint] NULL ,
  74. [NotifyPSS] [smallint] NULL ,
  75. [Priority] [tinyint] NULL ,
  76. [State] [tinyint] NULL ,
  77. [TrackID] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  78. [Stopcode] [int] NULL ,
  79. [sBucket] [int] NULL ,
  80. [gBucket] [int] NULL
  81. ) ON [PRIMARY]
  82. GO
  83. CREATE TABLE [dbo].[MailIncidents] (
  84. [IncidentID] [int] NOT NULL ,
  85. [SendMail] [smallint] NOT NULL
  86. ) ON [PRIMARY]
  87. GO
  88. CREATE TABLE [dbo].[MailTable] (
  89. [sBucket] [int] NOT NULL ,
  90. [HighID] [int] NOT NULL ,
  91. [LowID] [int] NOT NULL ,
  92. [email] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  93. [lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  94. ) ON [PRIMARY]
  95. GO
  96. CREATE TABLE [dbo].[Resources] (
  97. [ID] [int] IDENTITY (1, 1) NOT NULL ,
  98. [Category] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  99. [LinkTitle] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  100. [URL] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  101. [Lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  102. ) ON [PRIMARY]
  103. GO
  104. CREATE TABLE [dbo].[Response] (
  105. [Type] [smallint] NOT NULL ,
  106. [Lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  107. [Subject] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  108. [Description] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  109. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  110. GO
  111. CREATE TABLE [dbo].[Trans] (
  112. [TransactionID] [int] IDENTITY (1, 1) NOT NULL ,
  113. [HighID] [int] NOT NULL ,
  114. [LowID] [int] NOT NULL ,
  115. [Description] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  116. [TransDate] [datetime] NULL ,
  117. [SendMail] [tinyint] NULL ,
  118. [Type] [tinyint] NULL ,
  119. [Status] [smallint] NULL ,
  120. [FileCount] [int] NULL
  121. ) ON [PRIMARY]
  122. GO
  123. CREATE TABLE [dbo].[tempincidents] (
  124. [Incidentid] [int] IDENTITY (0, 1) NOT NULL ,
  125. [sendmail] [smallint] NULL
  126. ) ON [PRIMARY]
  127. GO
  128. ALTER TABLE [dbo].[Customer] WITH NOCHECK ADD
  129. CONSTRAINT [PK_Customer] PRIMARY KEY NONCLUSTERED
  130. (
  131. [HighID],
  132. [LowID]
  133. ) WITH FILLFACTOR = 90 ON [PRIMARY]
  134. GO
  135. ALTER TABLE [dbo].[Drivers] WITH NOCHECK ADD
  136. CONSTRAINT [PK_Driver] PRIMARY KEY NONCLUSTERED
  137. (
  138. [DriverID]
  139. ) WITH FILLFACTOR = 90 ON [PRIMARY]
  140. GO
  141. CREATE INDEX [IDX_Driver] ON [dbo].[Drivers]([Filename], [Version]) WITH FILLFACTOR = 90 ON [PRIMARY]
  142. GO
  143. ALTER TABLE [dbo].[Incident] WITH NOCHECK ADD
  144. CONSTRAINT [PK_Incident] PRIMARY KEY NONCLUSTERED
  145. (
  146. [IncidentID]
  147. ) WITH FILLFACTOR = 90 ON [PRIMARY]
  148. GO
  149. CREATE INDEX [IDX_Customer] ON [dbo].[Incident]([HighID], [LowID]) WITH FILLFACTOR = 90 ON [PRIMARY]
  150. GO
  151. CREATE INDEX [IDX_Hash] ON [dbo].[Incident]([DumpHash]) WITH FILLFACTOR = 90 ON [PRIMARY]
  152. GO
  153. CREATE INDEX [IDX_sBucket] ON [dbo].[Incident]([sBucket]) ON [PRIMARY]
  154. GO
  155. CREATE INDEX [IX_Incident] ON [dbo].[Incident]([TransactionID]) ON [PRIMARY]
  156. GO
  157. ALTER TABLE [dbo].[MailIncidents] WITH NOCHECK ADD
  158. CONSTRAINT [PK_MailIncidents] PRIMARY KEY NONCLUSTERED
  159. (
  160. [IncidentID]
  161. ) WITH FILLFACTOR = 90 ON [PRIMARY]
  162. GO
  163. ALTER TABLE [dbo].[Resources] WITH NOCHECK ADD
  164. CONSTRAINT [PK_ResourceID] PRIMARY KEY NONCLUSTERED
  165. (
  166. [ID]
  167. ) WITH FILLFACTOR = 90 ON [PRIMARY]
  168. GO
  169. CREATE INDEX [IX_Trans] ON [dbo].[Trans]([TransactionID]) ON [PRIMARY]
  170. GO