Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 please ...........what is the error

Author  Topic 

B5CSE
Starting Member

25 Posts

Posted - 2005-05-01 : 04:58:16
use banking
create table hesab_tawfeer
(
id int
foreign key references clients(id) on update no action ,
f_name varchar(20) not null ,
s_name varchar(20) not null ,
th_name varchar(20) not null ,
la_name varchar(20) not null ,
sav_code smallint not null
foreign key references coding(sav_code) on update cascade ,
br_code smallint not null
foreign key references coding(br_code) on update cascade ,
currency varchar(10),
money_amount money,
period_baring varchar(20),
date datetime default getdate()
)

when I execute that code then the erroe message occure

Server: Msg 1785, Level 16, State 1, Line 2
Introducing FOREIGN KEY constraint 'FK__hesab_taw__br_co__1920BF5C' on table 'hesab_tawfeer' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Server: Msg 1750, Level 16, State 1, Line 2
Could not create constraint. See previous errors.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-05-01 : 10:10:23
Sql server is telling you that you are trying to set up some referetial integrety that it won't be able to enforce under all cirmcumstances. This can happen for various reasons. We can't tell just from this one table. You'll have to post the DDL for your Coding table as well as any other table that is envolved with the "cycle" of cascading foreign key/primary key/unique constraints. You can also describe your objectives if you want advice on alternatives.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -