Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Check owners, collations and backups

    Orphan users should be considered as well

    CREATE TABLE #Results

    ([Database Name] sysname COLLATE Latin1_General_CI_AS,

    [Orphaned User] sysname COLLATE Latin1_General_CI_AS)

    SET NOCOUNT ON

    DECLARE @DBName sysname, @Qry nvarchar(4000)

    SET @Qry = ''

    SET @DBName =...

  • RE: Check owners, collations and backups

    Hi

    The script

    -- check whether database owners are valid

    select name into #check_database_owners

    from master.dbo.sysdatabases

    where isnull(suser_sname(sid),'no_owner') = 'no_owner'

    doesn't look like a valid.

    This one works better:

    IF SUBSTRING(@@version,23,4)='2000'

    select SD.name as DBname,

    suser_sname(SD.sid) as...

Viewing 2 posts - 1 through 2 (of 2 total)