USE [TZONEGPS_DEMO]
GO
/****** Object:  Table [dbo].[Type]    Script Date: 10/28/2013 17:51:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Type](
	[TypeID] [int] IDENTITY(1,1) NOT NULL,
	[TypeName] [nvarchar](50) NULL,
	[isdelete] [int] NOT NULL,
	[Model] [nvarchar](50) NULL,
 CONSTRAINT [PK_Type] PRIMARY KEY CLUSTERED 
(
	[TypeID] 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
/****** Object:  Table [dbo].[TraceData]    Script Date: 10/28/2013 17:51:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TraceData](
	[TID] [int] IDENTITY(1,1) NOT NULL,
	[IMEI] [varchar](50) NULL,
	[TypeID] [int] NULL,
	[AlarmID] [varchar](20) NULL,
	[GStatus] [varchar](10) NULL,
	[Lat] [decimal](18, 6) NULL,
	[NS] [varchar](10) NULL,
	[Lng] [decimal](18, 6) NULL,
	[WE] [varchar](10) NULL,
	[Speed] [decimal](18, 2) NULL,
	[Direction] [decimal](18, 2) NULL,
	[PDOP] [decimal](18, 2) NULL,
	[HDOP] [decimal](18, 2) NULL,
	[VDOP] [decimal](18, 2) NULL,
	[VCS] [varchar](10) NULL,
	[VBV] [decimal](18, 2) NULL,
	[VCV] [decimal](18, 2) NULL,
	[ADA] [decimal](18, 2) NULL,
	[ADB] [decimal](18, 2) NULL,
	[LACCI] [varchar](10) NULL,
	[Temperature] [decimal](18, 2) NULL,
	[Mileage] [decimal](18, 4) NULL,
	[IO] [varchar](20) NULL,
	[RFID] [varchar](10) NULL,
	[Serial] [varchar](10) NULL,
	[TrackerTime] [datetime] NULL,
	[ServerTime] [datetime] NULL,
	[RTC] [datetime] NULL,
	[Address] [nvarchar](300) NULL,
	[C] [varchar](255) NULL,
	[isdelete] [int] NOT NULL,
	[TagIDList] [nvarchar](max) NULL,
 CONSTRAINT [PK_TraceData] PRIMARY KEY CLUSTERED 
(
	[TID] 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
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Product]    Script Date: 10/28/2013 17:51:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Product](
	[PID] [int] IDENTITY(1,1) NOT NULL,
	[TypeID] [int] NOT NULL,
	[IMEI] [varchar](20) NULL,
	[TrackerName] [nvarchar](200) NULL,
	[CreateTime] [datetime] NULL,
	[isdelete] [int] NOT NULL,
 CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED 
(
	[PID] 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
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Original]    Script Date: 10/28/2013 17:51:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Original](
	[OID] [int] IDENTITY(1,1) NOT NULL,
	[IMEI] [varchar](50) NULL,
	[TypeID] [int] NULL,
	[AlarmID] [varchar](20) NULL,
	[TrackerTime] [datetime] NULL,
	[ServerTime] [datetime] NULL,
	[RTC] [datetime] NULL,
	[Length] [int] NULL,
	[Message] [nvarchar](300) NULL,
	[C] [varchar](255) NULL,
	[isdelete] [int] NOT NULL,
 CONSTRAINT [PK_Original] PRIMARY KEY CLUSTERED 
(
	[OID] 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
SET ANSI_PADDING OFF
GO
/****** Object:  Default [DF__Type__isdelete__7E6CC920]    Script Date: 10/28/2013 17:51:09 ******/
ALTER TABLE [dbo].[Type] ADD  DEFAULT ((0)) FOR [isdelete]
GO
