<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www2.sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx</link><description>Once upon a time it was 2004, and I wrote what I have to say was a pretty cool little script . (Yes, I know the post is dated 2006, but that's because I dropped the ball and failed to back-date the posts when I moved them over here from my prior blog</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24059</link><pubDate>Mon, 05 Apr 2010 14:44:51 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24059</guid><dc:creator>Patrick Cahill</dc:creator><description>&lt;p&gt;Thank you for the script Adam. I don't know how many times I have had to go find all the FKs so I could make a change to a column. They will save me a lot a pain in some development projects that we are working on.&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24086</link><pubDate>Tue, 06 Apr 2010 05:17:26 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24086</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Thanks Adam ,as usual, very usefull script&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24087</link><pubDate>Tue, 06 Apr 2010 05:17:28 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24087</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Thanks Adam ,as usual, very usefull script&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24088</link><pubDate>Tue, 06 Apr 2010 05:17:29 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24088</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Thanks Adam ,as usual, very usefull script&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24124</link><pubDate>Wed, 07 Apr 2010 14:51:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24124</guid><dc:creator>Brian Tkatch</dc:creator><description>&lt;p&gt;bookmarked, thanx adam!&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24217</link><pubDate>Mon, 12 Apr 2010 18:06:08 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24217</guid><dc:creator>Ron Holyfield</dc:creator><description>&lt;p&gt;Hope to not have to deal with this but bookmarked in case - Thx.&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24505</link><pubDate>Thu, 22 Apr 2010 22:26:44 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24505</guid><dc:creator>Kimberly L. Tripp</dc:creator><description>&lt;p&gt;Hey there Adam (et al) - If you're interested in the code that I use to generate the following:&lt;/p&gt;
&lt;p&gt;* disabling the NC indexes&lt;/p&gt;
&lt;p&gt;* disabling the FKs&lt;/p&gt;
&lt;p&gt;This is where you'd change the CL index...&lt;/p&gt;
&lt;p&gt;* re-enabling (and very important RECHECKING! of the FK constraints)&lt;/p&gt;
&lt;p&gt;* REBUILDS of the disabled nonclustered indexes.&lt;/p&gt;
&lt;p&gt;All of this is described and detailed in the SQL Server Magazine Q&amp;amp;A where I answer how to Change the Definition of a Clustered Index. Here's the link: &lt;a rel="nofollow" target="_new" href="http://www.sqlmag.com/blogs/sql-server-questions-answered/sql-server-questions-answered/tabid/1977/entryid/12749/Default.aspx"&gt;http://www.sqlmag.com/blogs/sql-server-questions-answered/sql-server-questions-answered/tabid/1977/entryid/12749/Default.aspx&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;It's not a script (like yours) but more the process and TSQL to change a clustered index.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;kt&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#24572</link><pubDate>Mon, 26 Apr 2010 03:18:56 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24572</guid><dc:creator>Adam Tappis</dc:creator><description>&lt;p&gt;Great script, thanks. Hope you don't mind me mentioning but you have left one reference to INFORMATION_SCHEMA, on the first line :)&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#35074</link><pubDate>Thu, 21 Apr 2011 13:17:47 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35074</guid><dc:creator>LLL</dc:creator><description>&lt;p&gt;A MILLION THANKS! &amp;nbsp;This script is perfect for what I need. &amp;nbsp;I want to be able to truncate the tables in a schema, pull a copy of data in, and then re-apply the constraints. &amp;nbsp;I added an @FKOnly parameter to determine if foreign keys only are needed in output. &amp;nbsp;Also added @DropOrCreate parameter to get drops all at once and creates separately as I'm looping a call to this SP for every object.&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#37374</link><pubDate>Thu, 28 Jul 2011 14:15:52 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37374</guid><dc:creator>Bigpa</dc:creator><description>&lt;p&gt;Excellent, your script has really helped me out !&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#43553</link><pubDate>Fri, 25 May 2012 14:58:29 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43553</guid><dc:creator>Binyam</dc:creator><description>&lt;p&gt;Many thanks Adam for all the scripts. You are making me lazy !!??&lt;/p&gt;
</description></item><item><title>re: Rejuvenated: Script Creates and Drops for Candidate Keys and Referencing Foreign Keys</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2010/04/04/rejuvinated-script-creates-and-drops-for-candidate-keys-and-referencing-foreign-keys.aspx#44491</link><pubDate>Mon, 30 Jul 2012 10:16:04 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44491</guid><dc:creator>gaol</dc:creator><description>&lt;p&gt;why when i run the script error near in 'kc.key_columns'? any body can give me the example? because i don't know how to replace like [-- Create Candidate Keys] in table&lt;/p&gt;
</description></item></channel></rss>