- 爱易网页
-
MSSQL教程
- 请教小弟我的表这样设计 是否合理 有什么弊端
日期:2014-05-19 浏览次数:20510 次
请问我的表这样设计 是否合理 有什么弊端
if exists (select * from dbo.sysobjects where id = object_id(N '[dbo].[BM_Person] ') and OBJECTPROPERTY(id, N 'IsUserTable ') = 1)
drop table [dbo].[BM_Person]
GO
if exists (select * from dbo.sysobjects where id = object_id(N '[dbo].[BM] ') and OBJECTPROPERTY(id, N 'IsUserTable ') = 1)
drop table [dbo].[BM]
GO
if exists (select * from dbo.sysobjects where id = object_id(N '[dbo].[BM_zhiwu] ') and OBJECTPROPERTY(id, N 'IsUserTable ') = 1)
drop table [dbo].[BM_zhiwu]
GO
if exists (select * from dbo.sysobjects where id = object_id(N '[dbo].[BM_yuangong] ') and OBJECTPROPERTY(id, N 'IsUserTable ') = 1)
drop table [dbo].[BM_yuangong]
GO
CREATE TABLE [dbo].[BM_Person] (
[bm_id] [int] NULL ,
[person_id] [int] NULL ,
[zhiwu_id] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[BM] (
[BM_id] [int] IDENTITY (1, 1) NOT NULL ,
[BM_name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[BM_miaoshu] [varchar] (8000) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[BM_zhiwu] (
[zhiwu_id] [int] IDENTITY (1, 1) NOT NULL ,
[zhiwu_name] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
[zhiwu_bm_id] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[BM_yuangong] (
[Person_id] [int] IDENTITY (1, 1) NOT NULL ,
[Person_zhuangtai] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_daima] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_xingming] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_xingbie] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_jiguan] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_chusheng] [datetime] NULL ,
[Person_ruzhi] [datetime] NULL ,
[Person_xueli] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_xuexiao] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_zhuanye] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_dianhua] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_fenji] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_shouji] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Person_dizhi] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,