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.

222 lines
7.5 KiB

  1. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Contacts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  2. drop table [dbo].[Contacts]
  3. GO
  4. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DeliveryTypeMap]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  5. drop table [dbo].[DeliveryTypeMap]
  6. GO
  7. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DeliveryTypes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  8. drop table [dbo].[DeliveryTypes]
  9. GO
  10. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HelpInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  11. drop table [dbo].[HelpInfo]
  12. GO
  13. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MSSolution]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  14. drop table [dbo].[MSSolution]
  15. GO
  16. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Modules]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  17. drop table [dbo].[Modules]
  18. GO
  19. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Products]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  20. drop table [dbo].[Products]
  21. GO
  22. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SolutionEx]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  23. drop table [dbo].[SolutionEx]
  24. GO
  25. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SolutionTypes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  26. drop table [dbo].[SolutionTypes]
  27. GO
  28. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SolvedBuckets]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  29. drop table [dbo].[SolvedBuckets]
  30. GO
  31. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Templates]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  32. drop table [dbo].[Templates]
  33. GO
  34. CREATE TABLE [dbo].[Contacts] (
  35. [ContactID] [int] IDENTITY (1, 1) NOT NULL ,
  36. [CompanyName] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  37. [CompanyAddress1] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  38. [CompanyAddress2] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  39. [CompanyCity] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  40. [CompanyState] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  41. [CompanyZip] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  42. [CompanyMainPhone] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  43. [CompanySupportPhone] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  44. [CompanyFax] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  45. [CompanyWebSite] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  46. [ContactName] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  47. [ContactOccupation] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  48. [ContactAddress1] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  49. [ContactAddress2] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  50. [ContactCity] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  51. [ContactState] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  52. [ContactZip] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  53. [ContactPhone] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  54. [ContactEMail] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  55. ) ON [PRIMARY]
  56. GO
  57. CREATE TABLE [dbo].[DeliveryTypeMap] (
  58. [MapID] [int] IDENTITY (1, 1) NOT NULL ,
  59. [SolutionTypeID] [int] NOT NULL ,
  60. [DeliveryTypeID] [int] NOT NULL
  61. ) ON [PRIMARY]
  62. GO
  63. CREATE TABLE [dbo].[DeliveryTypes] (
  64. [DeliveryID] [int] IDENTITY (1, 1) NOT NULL ,
  65. [DeliveryType] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  66. ) ON [PRIMARY]
  67. GO
  68. CREATE TABLE [dbo].[HelpInfo] (
  69. [iStopCode] [int] NULL ,
  70. [StopCode] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  71. [Lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  72. [KBs] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  73. ) ON [PRIMARY]
  74. GO
  75. CREATE TABLE [dbo].[MSSolution] (
  76. [MSSolutionID] [int] NOT NULL ,
  77. [SolutionProvider] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  78. [SolutionText] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
  79. [LastUpdated] [smalldatetime] NOT NULL
  80. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  81. GO
  82. CREATE TABLE [dbo].[Modules] (
  83. [ModuleID] [int] IDENTITY (1, 1) NOT NULL ,
  84. [ModuleName] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  85. ) ON [PRIMARY]
  86. GO
  87. CREATE TABLE [dbo].[Products] (
  88. [ProductID] [int] IDENTITY (1, 1) NOT NULL ,
  89. [ProductName] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  90. ) ON [PRIMARY]
  91. GO
  92. CREATE TABLE [dbo].[SolutionEx] (
  93. [SolutionID] [int] NOT NULL ,
  94. [Lang] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  95. [QueryData] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  96. [SolutionType] [tinyint] NULL ,
  97. [DeliveryType] [tinyint] NULL ,
  98. [SP] [tinyint] NULL ,
  99. [TemplateID] [int] NULL ,
  100. [ProductID] [int] NULL ,
  101. [Description] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  102. [ContactID] [int] NULL ,
  103. [ModuleID] [int] NULL ,
  104. [BugID] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  105. ) ON [PRIMARY]
  106. GO
  107. CREATE TABLE [dbo].[SolutionTypes] (
  108. [SolutionTypeID] [int] IDENTITY (1, 1) NOT NULL ,
  109. [SolutionTypeName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  110. ) ON [PRIMARY]
  111. GO
  112. CREATE TABLE [dbo].[SolvedBuckets] (
  113. [Bucket] [int] NOT NULL ,
  114. [SolutionID] [int] NOT NULL ,
  115. [BucketType] [tinyint] NOT NULL ,
  116. [strBucket] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  117. ) ON [PRIMARY]
  118. GO
  119. CREATE TABLE [dbo].[Templates] (
  120. [TemplateID] [int] IDENTITY (1, 1) NOT NULL ,
  121. [Description] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
  122. [TemplateName] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
  123. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  124. GO
  125. ALTER TABLE [dbo].[Contacts] WITH NOCHECK ADD
  126. CONSTRAINT [PK_Contacts] PRIMARY KEY CLUSTERED
  127. (
  128. [ContactID]
  129. ) ON [PRIMARY]
  130. GO
  131. ALTER TABLE [dbo].[DeliveryTypeMap] WITH NOCHECK ADD
  132. CONSTRAINT [PK_DeliveryTypeMap] PRIMARY KEY CLUSTERED
  133. (
  134. [MapID]
  135. ) ON [PRIMARY]
  136. GO
  137. ALTER TABLE [dbo].[DeliveryTypes] WITH NOCHECK ADD
  138. CONSTRAINT [PK_DeliveryTypes] PRIMARY KEY CLUSTERED
  139. (
  140. [DeliveryID]
  141. ) ON [PRIMARY]
  142. GO
  143. ALTER TABLE [dbo].[MSSolution] WITH NOCHECK ADD
  144. CONSTRAINT [PK_MSSolution] PRIMARY KEY CLUSTERED
  145. (
  146. [MSSolutionID]
  147. ) ON [PRIMARY]
  148. GO
  149. ALTER TABLE [dbo].[Modules] WITH NOCHECK ADD
  150. CONSTRAINT [PK_Modules] PRIMARY KEY CLUSTERED
  151. (
  152. [ModuleID]
  153. ) ON [PRIMARY]
  154. GO
  155. ALTER TABLE [dbo].[Products] WITH NOCHECK ADD
  156. CONSTRAINT [PK_Products] PRIMARY KEY CLUSTERED
  157. (
  158. [ProductID]
  159. ) ON [PRIMARY]
  160. GO
  161. ALTER TABLE [dbo].[SolutionEx] WITH NOCHECK ADD
  162. CONSTRAINT [PK_SolutionEx] PRIMARY KEY CLUSTERED
  163. (
  164. [SolutionID]
  165. ) ON [PRIMARY]
  166. GO
  167. ALTER TABLE [dbo].[SolutionTypes] WITH NOCHECK ADD
  168. CONSTRAINT [PK_SolutionTypes] PRIMARY KEY CLUSTERED
  169. (
  170. [SolutionTypeID]
  171. ) ON [PRIMARY]
  172. GO
  173. ALTER TABLE [dbo].[SolvedBuckets] WITH NOCHECK ADD
  174. CONSTRAINT [PK_SolvedBuckets] PRIMARY KEY CLUSTERED
  175. (
  176. [strBucket]
  177. ) ON [PRIMARY]
  178. GO
  179. ALTER TABLE [dbo].[Templates] WITH NOCHECK ADD
  180. CONSTRAINT [PK_Templates] PRIMARY KEY CLUSTERED
  181. (
  182. [TemplateID]
  183. ) ON [PRIMARY]
  184. GO
  185. CREATE INDEX [STOPCODE_INDEX] ON [dbo].[HelpInfo]([iStopCode]) ON [PRIMARY]
  186. GO
  187. CREATE INDEX [BUCKET_INDEX] ON [dbo].[SolvedBuckets]([Bucket]) ON [PRIMARY]
  188. GO