
if exists (select * from sysobjects where id = object_id(N'[dbo].[Account_Jen_AA]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Account_Jen_AA]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Bank_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Bank_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Buser_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Buser_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Item_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Item_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Jen_Print]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Jen_Print]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Kubun_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Kubun_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Project_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Project_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Sale_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Sale_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Sawon_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Sawon_Table]
GO


if exists (select * from sysobjects where id = object_id(N'[dbo].[Test_Ac_Code]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Test_Ac_Code]
GO



CREATE TABLE [dbo].[Account_Jen_AA]  (
	[Serial] [char] (100)     NULL ,
	[Serial_Jen] [char] (20)     NULL ,
	[Serial_Bun] [char] (3)     NULL ,
	[Serial_CrDr] [char] (3)     NULL ,
	[Month_Char] [char] (2)     NULL ,
	[Year_Char] [char] (4)     NULL ,
	[Date_Day] [char] (10)     NULL ,
	[Table_Kubun] [char] (5)     NULL ,
	[Kubun_Bon] [char] (5)     NULL ,
	[Kubun_Jen] [char] (2)     NULL ,
	[Kubun_Amt] [char] (2)     NULL ,
	[Form_Kubun] [char] (50)     NULL ,
	[Giel_Serial] [char] (30)     NULL ,
	[Ac_JenCode] [char] (12)     NULL ,
	[Ac_JenName] [char] (90)     NULL ,
	[Ac_Text] [char] (200)     NULL ,
	[Item_Code] [char] (20)     NULL ,
	[Item_Name] [char] (200)     NULL ,
	[Kubun_Code] [char] (20)     NULL ,
	[Kubun_Name] [char] (200)     NULL ,
	[Project_Code] [char] (20)     NULL ,
	[Project_Name] [char] (200)     NULL ,
	[Buser_Code] [char] (20)     NULL ,
	[Buser_Name] [char] (100)     NULL ,
	[Sawon_Code] [char] (20)     NULL ,
	[Sawon_Name] [char] (100)     NULL ,
	[Cr_Amt] [numeric](18, 0) NULL ,
	[Dr_Amt] [numeric](18, 0) NULL ,
	[Check_01] [char] (5)     NULL ,
	[Check_02] [char] (5)     NULL ,
	[Check_03] [char] (5)     NULL ,
	[End_Day] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Bank_Table] (
	[Bank_Code] [char] (15)     NOT NULL ,
	[Bank_Name] [char] (50)     NULL ,
	[Bank_Serial] [char] (50)     NULL ,
	[Bank_Text] [char] (100)     NULL ,
	[Bank_Datetime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Buser_Table] (
	[Buser_Code] [char] (15)     NOT NULL ,
	[Buser_Name] [char] (50)     NULL ,
	[Buser_Text] [char] (100)     NULL ,
	[Buser_Datetime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Item_table] (
	[Item_Code] [char] (15)     NOT NULL ,
	[Item_Name] [char] (50)     NULL ,
	[Item_Text] [char] (100)     NULL ,
	[Item_Datetime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Jen_Print] (
	[Tot] [varchar] (2)     NOT NULL ,
	[Serial_Bun] [char] (3)     NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Kubun_Table] (
	[Kubun_Code] [char] (5)     NOT NULL ,
	[Kubun_Name] [char] (50)     NULL ,
	[Kubun_JangSo] [char] (50)     NULL ,
	[Kubun_Text] [char] (100)     NULL ,
	[Kubun_DateTime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Project_table] (
	[Project_Code] [char] (15)     NOT NULL ,
	[Project_Name] [char] (50)     NULL ,
	[Project_Text] [char] (100)     NULL ,
	[Project_Datetime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Sale_Table] (
	[Sale_Code] [char] (15)     NOT NULL ,
	[Sale_Name] [char] (50)     NULL ,
	[Sale_Serial01] [char] (3)     NULL ,
	[Sale_Serial02] [char] (2)     NULL ,
	[Sale_Serial03] [char] (5)     NULL ,
	[Sale_Check] [char] (10)     NULL ,
	[Sale_Text] [char] (100)     NULL ,
	[Sale_Datetime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Sawon_Table] (
	[Sawon_Code] [char] (15)     NOT NULL ,
	[Sawon_Name] [char] (30)     NULL ,
	[Sawon_Kubun] [char] (10)     NULL ,
	[Sawon_Jumin01] [char] (6)     NULL ,
	[Sawon_Jumin02] [char] (7)     NULL ,
	[Sawon_Check] [char] (10)     NULL ,
	[Sawon_Text] [char] (100)     NULL ,
	[Sawon_Datetime] [datetime] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Test_AC_Code] (
	[Serial_No] [char] (10)     NULL ,
	[A_Kubun] [char] (1)     NULL ,
	[B_Kubun] [char] (2)     NULL ,
	[C_Kubun] [char] (2)     NULL ,
	[D_Kubun] [char] (3)     NULL ,
	[E_Kubun] [char] (3)     NULL ,
	[Ac_Code] [char] (12)     NULL ,
	[Ac_Name] [char] (90)     NULL ,
	[Ac_Name_Sisan] [char] (90)     NULL ,
	[Ac_Name_Gita] [char] (90)     NULL ,
	[Jan_Check] [char] (2)     NULL ,
	[The_Code] [char] (12)     NULL ,
	[Code_Kubun] [char] (20)     NULL ,
	[Code_MoveCode] [char] (12)     NULL ,
	[Code_TwoMove] [char] (12)     NULL ,
	[Code_ThreeMove] [char] (12)     NULL ,
	[Bigo] [char] (90)     NULL 
) ON [PRIMARY]
GO
