首页上一页 1 下一页尾页 3 条记录 1/1页
<>03企业人事管理系统
发表在Java图书答疑
2009-06-05
是否精华
是
否
版块置顶:
是
否
设置时间:
非永久
永久
起始时间:
结束时间:
是否扣分:
是
否
数据库 oracle10G 改为sql2000。 代码 要怎么改? oracle 看来短时间搞不定了 给个数据库 顺便 谢谢
精彩评论 3
2009-06-05
沙发
下面是SQL Server 2000的脚本语言,请在的企业管理器中建立一个db_personnel的数据库,然后选择该数据库,单击工具菜单中的查询分析器,把下面全部代码复制到查询分析器中,单击查询分析器工具栏中的执行按钮(即绿色的小三角)即可创建数据库。
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_ACCES]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_ACCES
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECKO_REFERENCE_TB_ACCOU]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_reckoning_info] DROP CONSTRAINT FK_TB_RECKO_REFERENCE_TB_ACCOU
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_TIMEC_REFERENCE_TB_ACCOU]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_timecard] DROP CONSTRAINT FK_TB_TIMEC_REFERENCE_TB_ACCOU
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_BRING_REFERENCE_TB_BRING]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_bring_up_ontent] DROP CONSTRAINT FK_TB_BRING_REFERENCE_TB_BRING
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DEPT_REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_dept] DROP CONSTRAINT FK_TB_DEPT_REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_REWAR_REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_rewards_and_punishment] DROP CONSTRAINT FK_TB_REWAR_REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_TIMEC_REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_timecard] DROP CONSTRAINT FK_TB_TIMEC_REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_DUTY]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_DUTY
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECOR_REFERENCE_TB_NATIO]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_record] DROP CONSTRAINT FK_TB_RECOR_REFERENCE_TB_NATIO
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECOR_REFERENCE_TB_NATIV]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_record] DROP CONSTRAINT FK_TB_RECOR_REFERENCE_TB_NATIV
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECKO_REFERENCE_TB_RECKO]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_reckoning_info] DROP CONSTRAINT FK_TB_RECKO_REFERENCE_TB_RECKO
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_BRING_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_bring_up_ontent] DROP CONSTRAINT FK_TB_BRING_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_MANAG_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_manager] DROP CONSTRAINT FK_TB_MANAG_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_PERSO_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_personal_info] DROP CONSTRAINT FK_TB_PERSO_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECKO_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_reckoning_list] DROP CONSTRAINT FK_TB_RECKO_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_REWAR_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_rewards_and_punishment] DROP CONSTRAINT FK_TB_REWAR_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_TIMEC_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_timecard] DROP CONSTRAINT FK_TB_TIMEC_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_accession_form]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_accession_form]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_account_item]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_account_item]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_bring_up_content]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_bring_up_content]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_bring_up_ontent]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_bring_up_ontent]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_dept]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_dept]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_duty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_duty]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_duty_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_duty_info]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_manager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_manager]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_nation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_nation]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_native_place]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_native_place]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_personal_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_personal_info]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_reckoning]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_reckoning]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_reckoning_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_reckoning_info]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_reckoning_list]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_reckoning_list]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_record]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_record]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_rewards_and_punishment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_rewards_and_punishment]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_timecard]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_timecard]
GO
CREATE TABLE [dbo].[tb_accession_form] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_account_item] (
[id] [int] NOT NULL ,
[name] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[type] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[unit] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[is_timecard] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_bring_up_content] (
[id] [int] NOT NULL ,
[name] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[content] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[object] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[start_date] [datetime] NOT NULL ,
[end_date] [datetime] NOT NULL ,
[unit] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[lecturer] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[place] [varchar] (60) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_bring_up_ontent] (
[id] [int] NOT NULL ,
[bring_up_content_id] [int] NOT NULL ,
[record_id] [int] NOT NULL ,
[score] [int] NULL ,
[up_to_grade] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[remark] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_dept] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[parent_id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_duty] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_duty_info] (
[id] [int] NOT NULL ,
[dept_id] [int] NOT NULL ,
[duty_id] [int] NOT NULL ,
[accession_date] [datetime] NOT NULL ,
[accession_form_id] [int] NOT NULL ,
[dimission_date] [datetime] NULL ,
[dimission_reason] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[first_pact_date] [datetime] NULL ,
[pact_start_date] [datetime] NULL ,
[pact_end_date] [datetime] NULL ,
[bank_name] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
[bank_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[society_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[annuity_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[dole_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[medicare_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[compo_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[accumulation_fund_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_manager] (
[id] [int] NOT NULL ,
[password] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[state] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[purview] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_nation] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_native_place] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_personal_info] (
[id] [int] NOT NULL ,
[QQ] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[E_mail] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[handset] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
[telephone] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
[address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[postalcode] [char] (6) COLLATE Chinese_PRC_CI_AS NULL ,
[second_school_age] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[second_specialty] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
[graduate_school] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
[graduate_date] [datetime] NULL ,
[party_member_date] [datetime] NULL ,
[computer_grade] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[likes] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[ones_strong_suit] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_reckoning] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[explain] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_reckoning_info] (
[id] [int] NOT NULL ,
[reckoning_id] [int] NOT NULL ,
[account_item_id] [int] NOT NULL ,
[money] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_reckoning_list] (
[record_id] [int] NOT NULL ,
[reckoning_id] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_record] (
[id] [int] NOT NULL ,
[record_number] [char] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[name] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[sex] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[birthday] [datetime] NOT NULL ,
[photo] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[ID_card] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[marriaged] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[nation_id] [int] NOT NULL ,
[native_place_id] [int] NOT NULL ,
[address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[postalcode] [char] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[party_member] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[school_age] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[specialty] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[foreign_language] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[grade] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_rewards_and_punishment] (
[id] [int] NOT NULL ,
[record_id] [int] NOT NULL ,
[type] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[reason] [varchar] (60) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[content] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[money] [int] NOT NULL ,
[start_date] [datetime] NOT NULL ,
[end_date] [datetime] NOT NULL ,
[ratifier_dept_id] [int] NOT NULL ,
[ratifier_record_id] [int] NOT NULL ,
[ratifier_date] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_timecard] (
[id] [int] NOT NULL ,
[record_id] [int] NOT NULL ,
[account_item_id] [int] NOT NULL ,
[explain] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[start_date] [datetime] NOT NULL ,
[end_date] [datetime] NOT NULL ,
[ratifier_dept_id] [int] NOT NULL ,
[ratifier_record_id] [int] NOT NULL ,
[ratifier_date] [datetime] NOT NULL
) ON [PRIMARY]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_ACCES]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_ACCES
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECKO_REFERENCE_TB_ACCOU]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_reckoning_info] DROP CONSTRAINT FK_TB_RECKO_REFERENCE_TB_ACCOU
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_TIMEC_REFERENCE_TB_ACCOU]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_timecard] DROP CONSTRAINT FK_TB_TIMEC_REFERENCE_TB_ACCOU
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_BRING_REFERENCE_TB_BRING]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_bring_up_ontent] DROP CONSTRAINT FK_TB_BRING_REFERENCE_TB_BRING
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DEPT_REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_dept] DROP CONSTRAINT FK_TB_DEPT_REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_REWAR_REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_rewards_and_punishment] DROP CONSTRAINT FK_TB_REWAR_REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_TIMEC_REFERENCE_TB_DEPT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_timecard] DROP CONSTRAINT FK_TB_TIMEC_REFERENCE_TB_DEPT
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_DUTY]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_DUTY
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECOR_REFERENCE_TB_NATIO]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_record] DROP CONSTRAINT FK_TB_RECOR_REFERENCE_TB_NATIO
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECOR_REFERENCE_TB_NATIV]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_record] DROP CONSTRAINT FK_TB_RECOR_REFERENCE_TB_NATIV
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECKO_REFERENCE_TB_RECKO]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_reckoning_info] DROP CONSTRAINT FK_TB_RECKO_REFERENCE_TB_RECKO
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_BRING_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_bring_up_ontent] DROP CONSTRAINT FK_TB_BRING_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_DUTY__REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_duty_info] DROP CONSTRAINT FK_TB_DUTY__REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_MANAG_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_manager] DROP CONSTRAINT FK_TB_MANAG_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_PERSO_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_personal_info] DROP CONSTRAINT FK_TB_PERSO_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_RECKO_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_reckoning_list] DROP CONSTRAINT FK_TB_RECKO_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_REWAR_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_rewards_and_punishment] DROP CONSTRAINT FK_TB_REWAR_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_TB_TIMEC_REFERENCE_TB_RECOR]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tb_timecard] DROP CONSTRAINT FK_TB_TIMEC_REFERENCE_TB_RECOR
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_accession_form]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_accession_form]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_account_item]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_account_item]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_bring_up_content]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_bring_up_content]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_bring_up_ontent]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_bring_up_ontent]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_dept]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_dept]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_duty]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_duty]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_duty_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_duty_info]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_manager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_manager]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_nation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_nation]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_native_place]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_native_place]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_personal_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_personal_info]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_reckoning]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_reckoning]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_reckoning_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_reckoning_info]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_reckoning_list]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_reckoning_list]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_record]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_record]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_rewards_and_punishment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_rewards_and_punishment]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_timecard]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_timecard]
GO
CREATE TABLE [dbo].[tb_accession_form] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_account_item] (
[id] [int] NOT NULL ,
[name] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[type] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[unit] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[is_timecard] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_bring_up_content] (
[id] [int] NOT NULL ,
[name] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[content] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[object] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[start_date] [datetime] NOT NULL ,
[end_date] [datetime] NOT NULL ,
[unit] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[lecturer] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[place] [varchar] (60) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_bring_up_ontent] (
[id] [int] NOT NULL ,
[bring_up_content_id] [int] NOT NULL ,
[record_id] [int] NOT NULL ,
[score] [int] NULL ,
[up_to_grade] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[remark] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_dept] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[parent_id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_duty] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_duty_info] (
[id] [int] NOT NULL ,
[dept_id] [int] NOT NULL ,
[duty_id] [int] NOT NULL ,
[accession_date] [datetime] NOT NULL ,
[accession_form_id] [int] NOT NULL ,
[dimission_date] [datetime] NULL ,
[dimission_reason] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[first_pact_date] [datetime] NULL ,
[pact_start_date] [datetime] NULL ,
[pact_end_date] [datetime] NULL ,
[bank_name] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
[bank_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[society_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[annuity_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[dole_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[medicare_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[compo_safety_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[accumulation_fund_NO] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_manager] (
[id] [int] NOT NULL ,
[password] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[state] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[purview] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_nation] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_native_place] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_personal_info] (
[id] [int] NOT NULL ,
[QQ] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[E_mail] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[handset] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
[telephone] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
[address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[postalcode] [char] (6) COLLATE Chinese_PRC_CI_AS NULL ,
[second_school_age] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[second_specialty] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
[graduate_school] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
[graduate_date] [datetime] NULL ,
[party_member_date] [datetime] NULL ,
[computer_grade] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[likes] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[ones_strong_suit] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_reckoning] (
[id] [int] NOT NULL ,
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[explain] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_reckoning_info] (
[id] [int] NOT NULL ,
[reckoning_id] [int] NOT NULL ,
[account_item_id] [int] NOT NULL ,
[money] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_reckoning_list] (
[record_id] [int] NOT NULL ,
[reckoning_id] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_record] (
[id] [int] NOT NULL ,
[record_number] [char] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[name] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[sex] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[birthday] [datetime] NOT NULL ,
[photo] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[ID_card] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[marriaged] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[nation_id] [int] NOT NULL ,
[native_place_id] [int] NOT NULL ,
[address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[postalcode] [char] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[party_member] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[school_age] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[specialty] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[foreign_language] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[grade] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_rewards_and_punishment] (
[id] [int] NOT NULL ,
[record_id] [int] NOT NULL ,
[type] [char] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[reason] [varchar] (60) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[content] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[money] [int] NOT NULL ,
[start_date] [datetime] NOT NULL ,
[end_date] [datetime] NOT NULL ,
[ratifier_dept_id] [int] NOT NULL ,
[ratifier_record_id] [int] NOT NULL ,
[ratifier_date] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tb_timecard] (
[id] [int] NOT NULL ,
[record_id] [int] NOT NULL ,
[account_item_id] [int] NOT NULL ,
[explain] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[start_date] [datetime] NOT NULL ,
[end_date] [datetime] NOT NULL ,
[ratifier_dept_id] [int] NOT NULL ,
[ratifier_record_id] [int] NOT NULL ,
[ratifier_date] [datetime] NOT NULL
) ON [PRIMARY]
GO