<?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>Updated Warehouse Re-Index Script</title><link>http://www2.sqlblog.com/blogs/merrill_aldrich/archive/2013/01/14/updated-warehouse-re-index-script.aspx</link><description>As I talked about in my last post , I just went through a re-indexing project that took the partitioned fact rows from our warehouse and relocated them into new files. There are a lot of tables and indexes involved, so I have a PowerShell “helper” script</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Updated Warehouse Re-Index Script</title><link>http://www2.sqlblog.com/blogs/merrill_aldrich/archive/2013/01/14/updated-warehouse-re-index-script.aspx#47163</link><pubDate>Tue, 15 Jan 2013 09:01:21 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47163</guid><dc:creator>Gonçalo Ferreira</dc:creator><description>&lt;p&gt;Something like the following would probably be more readable.&lt;/p&gt;
&lt;p&gt;$indexCreateScr = $indexCreateScr -replace `&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'ALTER TABLE (.+?) ADD &amp;nbsp;CONSTRAINT (.+?) PRIMARY KEY CLUSTERED', `&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ('/* $&amp;amp; */' + &amp;quot;`n&amp;quot; + 'CREATE UNIQUE CLUSTERED INDEX $2 ON $1')&lt;/p&gt;
</description></item></channel></rss>