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
 General SQL Server Forums
 New to SQL Server Administration
 Constraints

Author  Topic 

gupta
Starting Member

25 Posts

Posted - 2011-02-18 : 15:11:12
HI Guys,

Can you please help me in how to put ON DELETE CASCADE on existing column?.

Please let me know what command I need to perform to put ON DELETE CASCADE on existing column.

Thanks-Harinath

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-02-18 : 15:13:10
Are you absolutely sure you need that feature? It's pretty dangerous and not recommended.

If you absolutely insist (and don't say you weren't warned) you'll find the syntax in Books Online under "ALTER TABLE...ADD CONSTRAINT".
Go to Top of Page

gupta
Starting Member

25 Posts

Posted - 2011-02-19 : 02:44:37
no no.......

actually, what I need is I created table with 4columns for one column I had give foreign key with references and then I executed.

now I need to give only ON DELETE CASCADE for that existing column(foreign key).

so is there any command to do this, if so please help me in resolving this issue.

Thanks-Harinath
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2011-02-19 : 07:30:57
you will need to drop the foreign constraint and again create it.
Go to Top of Page

gupta
Starting Member

25 Posts

Posted - 2011-03-08 : 14:19:30
Thanks for providing the solution and it work's out.
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2011-03-08 : 14:46:50
quote:
Originally posted by gupta

Thanks for providing the solution and it work's out.



You are welcome
Go to Top of Page
   

- Advertisement -