/****** Object: Table [dbo].[Import_main] Script Date: 09/02/2013 09:17:57 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Import_main]') AND type in (N'U')) DROP TABLE [dbo].[Import_main] GO /****** Object: Table [dbo].[Import_main] Script Date: 09/02/2013 09:17:57 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Import_main]( [id] [int] IDENTITY(1,1) NOT NULL, [ContractNo] [varchar](50) NOT NULL, [HTH] [varchar](50) NULL, [company] [varchar](50) NULL,-- [seller] [varchar](50) NULL, [buyer] [varchar](50) NULL, [STT] [varchar](50) NULL, [countryid] [varchar](50) NULL, creator [varchar](50) null, creattime datetime null,--- Auditor [varchar](50) null, Audittime datetime null,--- MainState tinyint default 0, printed tinyint default 0, AutoAPP [varchar](150) NULL, ShipCompany_id int default 0, Billno [varchar](50) NULL, BillType tinyint default 0, BillTime datetime null, Vessel [varchar](50) NULL, Voyage [varchar](50) NULL, Ex_sailingdate datetime null, Sailingdate datetime null, ArrivalDate datetime null, ContainerNo [varchar](50) NULL, SealNo [varchar](50) NULL, Freetime int null,--- TransactionMethod tinyint default 0, PaymentMethods tinyint default 0, SecurityDeposit tinyint default 0, CustomsReleaseDate datetime null, SamplingDate_Plan datetime null, SamplingDate_Act datetime null, inspection_Signup_date datetime null, inspection_no [varchar](50) NULL, inspection_date datetime null, timemark timestamp null, CIQ_licence [varchar](50) NULL,-- CIQ_canbesearch tinyint default 0,-- tax_date datetime null,-- tax_paydate datetime null,-- remark [varchar](150) NULL,-- port tinyint null, CONSTRAINT [PK_Import_main] PRIMARY KEY CLUSTERED ( [ContractNo] 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 insert into [Import_main] ([ContractNo],[HTH],[seller],[buyer],[countryid]) values ('A1','AA01','AA','AA','GB'); insert into [Import_main] ([ContractNo],[HTH],[seller],[buyer],[countryid]) values ('A2','bb02','bb','bb','FR'); insert into [Import_main] ([ContractNo],[HTH],[seller],[buyer],[countryid]) values ('A3','AA03','cc','cc','IN'); insert into [Import_main] ([ContractNo],[HTH],[seller],[buyer],[countryid]) values ('A4','AA014','dd','dd','DK'); select * from [Import_main] --update [Import_main] set ex_sailingdate =null where id=1 --select * from import_approval /* id ContractNo HTH company seller buyer STT countryid creator creattime Auditor Audittime MainState printed AutoAPP ShipCompany_id Billno BillType Vessel Voyage Ex_sailingdate Sailingdate ArrivalDate ContainerNo SealNo Freetime TransactionMethod PaymentMethods SecurityDeposit CustomsReleaseDate SamplingDate_Plan SamplingDate_Act inspection_Signup_date inspection_no inspection_date timemark CIQ_licence CIQ_canbesearch tax_date tax_paydate remark port */