2 回答
TA贡献1880条经验 获得超4个赞
USE [test]
GO
/****** 对象: Table [dbo].[project] 脚本日期: 05/21/2012 14:40:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[project](
[项目编号] [int] NOT NULL,
[项目负责人] [char](20) COLLATE Chinese_PRC_CI_AS NULL,
[项目难度级别] [int] NULL,
CONSTRAINT [pk_no] PRIMARY KEY CLUSTERED
(
[项目编号] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
USE [test]
GO
ALTER TABLE [dbo].[project] WITH NOCHECK ADD CONSTRAINT [FK_project_employee] FOREIGN KEY([项目负责人])
REFERENCES [dbo].[employee] ([员工姓名])
GO
ALTER TABLE [dbo].[project] WITH CHECK ADD CONSTRAINT [CK_project] CHECK (([项目难度级别]>=(1) AND [项目难度级别]<=(5)))
- 2 回答
- 0 关注
- 644 浏览
添加回答
举报