-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Hemang
Message 2 in Discussion
Hi Suki,
No circular reference is allowed.
You will have to store this Parent_ID with Cat_ID in different table to
achieve this.
Regards,
Hemang Dhamani - Microsoft India Community Star
----- Original Message -----
From:
thinkindotnet
To: BDOTNET
Sent: Wednesday, July 23, 2003 2:55
PM
Subject: ON DELETE CASCADE - SQL
2000
New Message on BDOTNET
ON DELETE
CASCADE - SQL 2000
Reply
Reply to Sender Recommend
Message 1 in
Discussion
From: thinkindotnet
Hi friends,
I have a self referencing table as follows.
[SQL 2000]
CREATE TABLE Tbl_Category
(
Cat_ID
int
IDENTITY (1, 1) NOT NULL,
Cat_Name
varchar(50) NULL,
Parent_ID
int NOT
NULL,
CONSTRAINT pk_Category PRIMARY KEY NONCLUSTERED
(Cat_ID)
)
GO
ALTER TABLE Tbl_Category ADD
CONSTRAINT RefConstCategory
FOREIGN KEY
(Parent_ID)
REFERENCES
Tbl_Category(Cat_ID)
ON DELETE
CASCADE
GO
Note that the field Parent_ID referes to field
Cat_ID.
I'm facing a problem while trying to create a ON DELETE
CASCADE on the same.
Please advice me
Thanx,
Suki
View other groups in this
category.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]