请教关系图级联删除的问题...
两张表分别是Member和News,现在想作关系图实现级联删除,
当Member表中的UserName被删除时同时删除News表中的所有News.input_name与Member.UserName的记录
提示错误:
“Member”表成功保存
“News”表
- 无法创建关系“FK_News_Member”。
ODBC 错误: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE 语句与 COLUMN FOREIGN KEY 约束 'FK_News_Member ' 冲突。该冲突发生于数据库 'lpsjmw_diysite ',表 'Member ', column 'UserName '。
CREATE TABLE [dbo].[Member] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[UserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[PassWord] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[E_Mail] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[CompanyApellation] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[BrandApellation] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Industry] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Kind] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Area] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Birthday] [datetime] NOT NULL ,
[Turnover] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[Postalcode] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Linkman] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[LinkPhone] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Fax] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[WebSite] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Introduction] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NULL ,
[RegisterDate] [datetime] NOT NULL ,
[Sort] [int] NOT NULL ,
[Stencil] [int] NOT NULL ,
[SMS] [bit] NOT NULL ,
[Duty] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Gender] [bit] NOT NULL ,
[MobileTeleph] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Distinction] [int] NOT NULL ,
[Pic] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[Auditing] [bit] NOT NULL ,
[QQ] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[News] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Title] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[Author] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[Sort] [int] NULL ,
[Small_Sort] [int] NULL ,
[Explain] &nbs