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)
 Modifying Foreign Key constraints

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2006-04-18 : 13:22:56
Guys,

How can I change the existing foreign key constraints to include 'ON DELETE CASCADE' & 'ON UPDATE CASCADE' clauses.

I want to be able to do this through SQL statements.

Is there any way I can turn the identity off for the identity column through SQL statements.

any suggestions/inputs would help

Sri

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-04-18 : 13:34:35
You have to drop the foreign key constraint and re-create it with the cascade options.

You cannot remove the identity property from an existing column. The best you can do is create a new column of the same data type, copy the identity column's values to that new column, then drop the identity column. You can also rename the new column to the identity column's name using the sp_rename procedure, see Books Online for details.
Go to Top of Page
   

- Advertisement -