• Hi

    This is fabulous. Thank you very much for making it available to us.

    I am having a couple of problems with this script. Please excuse any obvious newbie errors (but point them out to me so I learn) as I am still a relatively new DBA (just over 8 months now) and as all of my team mates have left and not been replaced yet, right now I am the only one and have no peer support on-site.

    When I try to run the script on servers with off-line databases it stops at the first off-line database. My T-SQL skills are not good enough to resolve this I don't think.

    Do I change line 283

    FROM sys.databases

    WHERE name NOT IN('tempdb','master','msdb','model') and name NOT LIKE '%ReportServer%'

    by adding

    AND state_desc = ONLINE

    Do I need to change anything else elsewhere?

    Secondly, I am getting the error

    Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "Latin1_General_CI_AS_KS_WS" in the equal to operation.

    This is coming up on servers which have Sharepoint databases on them which have to have their Collation set to Latin1_General_CI_AS_KS_WS according to the Sharepoint team.

    I have googled this and as I understand it there is a need to add COLLATE Database default or COLLATE Latin1_General_CI_AS but I have no idea where

    Apologies if this is obvious to some.

    https://blog.robsewell.com Its where I blog
    SQL Community Slack Channel https://sqlps.io/slack
    The Best PowerShell Module for the Modern SQL DBA https://dbatools.io
    Data South West User Group http://sqlsouthwest.co.uk/[/url]