USE [master]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE DATABASE [ServerInfo]
GO
USE [ServerInfo]
GO
CREATE TABLE [dbo].[tblBuildList](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Version] [varchar](100) NOT NULL,
	[ProductVersion] [varchar](100) NULL,
	[Build] [varchar](100) NOT NULL,
	[FileVersion] [varchar](100) NOT NULL,
	[KBDescription] [varchar](1000) NOT NULL,
	[URL] [varchar](1000) NULL,
	[ReleaseDate] [date] NOT NULL,
	[SP] [bit] NOT NULL,
	[CU] [bit] NOT NULL,
	[HF] [bit] NOT NULL,
	[RTM] [bit] NOT NULL,
	[CTP] [bit] NOT NULL,
	[LatestSP] [bit] NULL,
	[LatestCU] [bit] NULL,
	[New] [bit] NULL,
	[Comment] [varchar](1000) NOT NULL,
	[Major]  AS (CONVERT([int],case when parsename([Build],(4))>=(13) then parsename([Build],(4)) else parsename([Build],(3)) end)),
	[Minor]  AS (CONVERT([int],case when parsename([Build],(4))>=(13) then parsename([Build],(3)) else parsename([Build],(2)) end)),
	[BuildNr]  AS (CONVERT([int],case when parsename([Build],(4))>=(13) then parsename([Build],(2)) else parsename([Build],(1)) end)),
	[Revision]  AS (CONVERT([int],case when parsename([Build],(4))>=(13) then parsename([Build],(1))  end)),
 CONSTRAINT [PK_tblBuildList] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tblBuildListImport](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[LongSqlVersion] [varchar](1000) NULL,
	[SqlVersion] [varchar](1000) NULL,
	[htmlID] [int] NULL,
	[line] [varchar](8000) NULL,
	[ProductVersion] [varchar](1000) NULL,
	[build] [varchar](1000) NULL,
	[fileversion] [varchar](1000) NULL,
	[kb] [varchar](1000) NULL,
	[description] [varchar](1000) NULL,
	[url] [varchar](1000) NULL,
	[releasedate] [varchar](1000) NULL,
	[latest_sp] [bit] NULL,
	[latest_cu] [bit] NULL,
	[rtm] [bit] NULL,
	[new] [bit] NULL,
	[Major]  AS (CONVERT([int],case when parsename([build],(4))>=(13) then parsename([build],(4)) else parsename([build],(3)) end)),
	[Minor]  AS (CONVERT([int],case when parsename([build],(4))>=(13) then parsename([build],(3)) else parsename([build],(2)) end)),
	[BuildNr]  AS (CONVERT([int],case when parsename([build],(4))>=(13) then parsename([build],(2)) else parsename([build],(1)) end)),
	[Revision]  AS (CONVERT([int],case when parsename([build],(4))>=(13) then parsename([build],(1))  end))
) ON [PRIMARY]