• Thanks for taking the time to raise questions, Scott. Glad to help.

    The SID column is the SID of the creator. Scott pointed out that some servers may have databases that were created by sid=1 (sa) and would be excluded by this logic.

    My intent was to prevent the system databases from appearing.

    To see all the databases, including the system databases, remove the sid>1 conditonal.

    Conversely, you can restrain the results by changing the sid>1 phrase to name not in ('msdb','master','tempdb') or whatever databases you want to exclude.

    -- J.T.

    "I may not always know what I'm talking about, and you may not either."