﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Gregory Ferdinandsen  / SQL Server Index Defragmentation (Updated) / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 11:09:25 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SQL Server Index Defragmentation (Updated)</title><link>http://www.sqlservercentral.com/Forums/Topic1362428-2621-1.aspx</link><description>I think you may have just solved my riddle of why it fails on SharePoint DB's that contain GUID's in their names.  Thanks!Just to confirm, I ran it against a test server (with the ISGUID functionality commented out) , and like you said, it now handles _'s and -'s.  I've been spending months trying to figure this out, thanks again!</description><pubDate>Thu, 04 Oct 2012 05:19:50 GMT</pubDate><dc:creator>GregoryF</dc:creator></item><item><title>RE: SQL Server Index Defragmentation (Updated)</title><link>http://www.sqlservercentral.com/Forums/Topic1362428-2621-1.aspx</link><description>Nice script :-)Just a heads up - found a missing QUOTENAME here: (around @DBName)[i](only applies if you have underscores and/or hyphens and/or dashes in your database names)[/i] ;-)[code="sql"]--Get rid of the brackets :&amp;lt;--&amp;gt;: [IndexName] --&amp;gt; IndexNameset @IndexNameExists = substring(@IndexName, 2, len(@IndexName) - 2)set @SQLCmdExist = N'select @IndexExists = name from ' + @DBName + '.sys.indexes where name = ''' + @IndexNameExists + ''''set @PDExist = N'@IndexExists varchar(128) output'exec sp_executesql @SQLCmdExist, @PDExist, @IndexExists output[/code]Changed to:[code="sql"]set @SQLCmdExist = N'select @IndexExists = name from ' + QUOTENAME(@DBName) + '.sys.indexes where name = ''' + @IndexNameExists + ''''[/code]and now works without any errors on my servers.Thanks</description><pubDate>Thu, 04 Oct 2012 05:13:57 GMT</pubDate><dc:creator>gsc_dba</dc:creator></item><item><title>RE: SQL Server Index Defragmentation (Updated)</title><link>http://www.sqlservercentral.com/Forums/Topic1362428-2621-1.aspx</link><description>AAAH.....Sorry I was confused  :-PUpdated it to use our Utilities db and modified name to match our naming standards....It's so big going through it to make sure I understand which parameters to run is taking some time.</description><pubDate>Fri, 21 Sep 2012 08:21:57 GMT</pubDate><dc:creator>Brett Phipps</dc:creator></item><item><title>RE: SQL Server Index Defragmentation (Updated)</title><link>http://www.sqlservercentral.com/Forums/Topic1362428-2621-1.aspx</link><description>DBMonitor is just the name of our administrative database, it does not belong to a third party tool.  You can put the SP in any databasse (master, msdb, etc)</description><pubDate>Fri, 21 Sep 2012 08:05:55 GMT</pubDate><dc:creator>GregoryF</dc:creator></item><item><title>RE: SQL Server Index Defragmentation (Updated)</title><link>http://www.sqlservercentral.com/Forums/Topic1362428-2621-1.aspx</link><description>It says it supports SQL 2005 or greater but we don't have a DBMonitor database.  After searching it looks like this is a 3rd party tool from Devart?Perhaps this should be mentioned and a discussion of the pros/cons of installing this tool on your database should be included instead of just a teaser of Defrags all indexes.... with no mention of the need to install this.</description><pubDate>Fri, 21 Sep 2012 08:03:20 GMT</pubDate><dc:creator>Brett Phipps</dc:creator></item><item><title>SQL Server Index Defragmentation (Updated)</title><link>http://www.sqlservercentral.com/Forums/Topic1362428-2621-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Admin/92984/"&gt;SQL Server Index Defragmentation (Updated)&lt;/A&gt;[/B]</description><pubDate>Thu, 20 Sep 2012 23:50:29 GMT</pubDate><dc:creator>GregoryF</dc:creator></item></channel></rss>