????? ????? 1785 ???? ??? ????? ??? FOREIGN KEY ???? ?? ????? ?????? ????? ??????

?????? ????????? ?????? ?????????
???? ???????: 321843 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

?? ???? ????? ????? ??????? ??? ????? ??? FOREIGN KEY:
????: ?? ???? ????? 1785 ? 16 ??????? 1 ???? ???? 1 ??????? ?? FOREIGN KEY ????? 'fk_two' ??? ?????? '????2' ????? ?? ?????? ????? ??????. ????? ON DELETE NO ??????? ?? ??????? ?? UPDATE ON ?? ??????? ???? FOREIGN KEY ????. ????: ???? ????? ????? 1750 ? 16 ??????? 1 ???? ???? 1 ?????. ???? ??????? ???????.

?????

???? ????? ????? ??? ??? ?? SQL Server? ?? ???? ???? ???? ?? ??? ????? ?? ????? ?? ???? ????????? ??????? ????????? ???? ?? ??????? ?????? DELETE ?? ????? UPDATE. ??? ???? ??????? ??? ?? ???? ???? ??????? ??????? ????????? ??? ???? ???? ??? ???? ???? ??? ???? ??????? ??????? ?????????.

???? ??????

??????? ?????? ??? ??? ??????? ?? ??? ?????? ????? ????? ????? ?????? ???? ?? ???? ??? ???? ?? ????? ????????? ??????? ?????????.

????? ??? ??????? ??????? ???? ???. ??????? ??????? ???????? (DRI) ?? ??????? ???????? ????? ????? ????? ???? ??? ?????. ??? ????? ????? ???? ???? ?? ???? ???? ???? ????? ?? ???????, ????? ??????? ???????? ????? ?? ???.

??????? ????

????? ????????? ???????? ?????? ?? ???? ?????? ????? FOREIGN KEY ???? ?????? ????? ?????:

Use tempdb
go
create table table1 (user_ID integer not null primary key, user_name
char(50) not null)
go

create table table2 (author_ID integer not null primary key, author_name
char(50) not null, lastModifiedBy integer not null, addedby integer not
null)

go

alter table table2 add constraint fk_one foreign key (lastModifiedby)
references table1 (user_ID) on delete cascade on update cascade
go
alter table table2 add constraint fk_two foreign key (addedby)
references table1(user_ID) on delete no action on update cascade
go
--this fails with the error because it provides a second cascading path to table2.

alter table table2 add constraint fk_two foreign key (addedby)
references table1 (user_ID) on delete no action on update no action
go
-- this works.
				

?????

????? ?? ?????????? ???? ??????? "????????? ??????? ???? ?????" ?? SQL Server 2000 ????????.

???????

???? ???????: 321843 - ????? ??? ??????: 21/????/1428 - ??????: 3.4
????? ???
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000 Desktop Engine (Windows)
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Workgroup Edition
????? ??????: 
kbmt kbbug kbpending kbprb kbprogramming KB321843 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????321843

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com