if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[d_mtrd]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[d_mtrd]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[d_mtrin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[d_mtrin]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[d_mtro]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[d_mtro]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[d_mtrout]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[d_mtrout]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[d_vehicle]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[d_vehicle]
GO
CREATE TABLE [dbo].[d_mtrd] (
[fid] [ID] NOT NULL ,
[stime] [datetime] NOT NULL ,
[code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtr] [ID] NOT NULL ,
[batch] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[vehicle] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[gross] [int] NOT NULL ,
[tare] [int] NOT NULL ,
[suttle] [int] NOT NULL ,
[impur] [int] NOT NULL ,
[mem] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[del] [smallint] NOT NULL ,
[person] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ctime] [datetime] NOT NULL ,
[mperson] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtime] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[d_mtrin] (
[fid] [ID] NOT NULL ,
[STIME] [datetime] NOT NULL ,
[code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtr] [ID] NOT NULL ,
[org] [ID] NOT NULL ,
[batch] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[vehicle] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[gross] [int] NOT NULL ,
[tare] [int] NOT NULL ,
[suttle] [int] NOT NULL ,
[impur] [int] NOT NULL ,
[mem] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[del] [smallint] NOT NULL ,
[person] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ctime] [datetime] NOT NULL ,
[mperson] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtime] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[d_mtro] (
[fid] [ID] NOT NULL ,
[stime] [datetime] NOT NULL ,
[code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtr] [ID] NOT NULL ,
[org] [ID] NOT NULL ,
[batch] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[vehicle] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[gross] [int] NOT NULL ,
[tare] [int] NOT NULL ,
[suttle] [int] NOT NULL ,
[impur] [int] NOT NULL ,
[mem] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[del] [smallint] NOT NULL ,
[person] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ctime] [datetime] NOT NULL ,
[mperson] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtime] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[d_mtrout] (
[fid] [ID] NOT NULL ,
[stime] [datetime] NOT NULL ,
[code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtr] [ID] NOT NULL ,
[org] [ID] NOT NULL ,
[vehicle] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[gross] [int] NOT NULL ,
[tare] [int] NOT NULL ,
[suttle] [int] NOT NULL ,
[impur] [int] NOT NULL ,
[sell] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mem] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[del] [smallint] NOT NULL ,
[person] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ctime] [datetime] NOT NULL ,
[mperson] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[mtime] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[d_vehicle] (
[FID] [int] IDENTITY (1, 1) NOT NULL ,
[vehicle] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[tare] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[d_mtrd] WITH NOCHECK ADD
CONSTRAINT [DF__d_mtrd__del__0E0EFF63] DEFAULT (0) FOR [del]
GO
ALTER TABLE [dbo].[d_mtrin] WITH NOCHECK ADD
CONSTRAINT [DF__d_mtrin__del__0FF747D5] DEFAULT (0) FOR [del]
GO
ALTER TABLE [dbo].[d_mtro] WITH NOCHECK ADD
CONSTRAINT [DF__d_mtro__del__11DF9047] DEFAULT (0) FOR [del]
GO
ALTER TABLE [dbo].[d_mtrout] WITH NOCHECK ADD
CONSTRAINT [DF__d_mtrout__del__13C7D8B9] DEFAULT (0) FOR [del]
GO