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.
| Author |
Topic |
|
sql_buddy
Starting Member
41 Posts |
Posted - 2009-07-06 : 05:16:53
|
| i want to remove cluster index from primary key ,without dropping primary key as for dropping primary key i have to remove all foreign key constraintsthen drop primary key add primary key with non clustered index and then add foreign keys constraints |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-07-06 : 06:46:02
|
| If the clustered index is enforcing the primary key (ie it was created by creating the primary key), it cannot be dropped without dropping the primary key.You are correct in the procedure that you'll have to follow to make the pk nonclustered.--Gail ShawSQL Server MVP |
 |
|
|
sql_buddy
Starting Member
41 Posts |
Posted - 2009-07-06 : 08:02:56
|
| can i find all the foreign key constraints assosciated to a table'primarykeyusing script |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-07-06 : 08:09:59
|
sp_depends OR in futuresys.dm_sql_referencing_entities and sys.dm_sql_referenced_entities. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-07-06 : 08:13:29
|
In SSMS right click on table name and choose 'view dependencies'. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2009-07-06 : 08:18:22
|
| or use SYS.FOREIGN_KEY_COLUMNS |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|