|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 3:40 AM
Points: 961,
Visits: 794
|
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 8:38 AM
Points: 93,
Visits: 207
|
|
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.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 3:40 AM
Points: 961,
Visits: 794
|
|
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)
/* ----------------------------- */ Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 8:38 AM
Points: 93,
Visits: 207
|
|
AAAH.....Sorry I was confused 
Updated 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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 6:48 AM
Points: 1,065,
Visits: 1,328
|
|
Nice script 
Just a heads up - found a missing QUOTENAME here: (around @DBName) (only applies if you have underscores and/or hyphens and/or dashes in your database names) 
--Get rid of the brackets :<-->: [IndexName] --> IndexName set @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
Changed to:
set @SQLCmdExist = N'select @IndexExists = name from ' + QUOTENAME(@DBName) + '.sys.indexes where name = ''' + @IndexNameExists + ''''
and now works without any errors on my servers.
Thanks
_____________________________________________________________________________________ gsc_dba
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 3:40 AM
Points: 961,
Visits: 794
|
|
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!
/* ----------------------------- */ Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!
|
|
|
|