• sp_MSforeachdb is indeed a cursor, and not a particularly good one.

    Still, it exists, and it's useful for quick-and-dirty tasks sometimes, particularly if you don't have a lot of dbs.

    So, I'll offer a version for it:

    CREATE TABLE #t_nodb (

    dbname nvarchar(128)

    )

    EXEC sp_MSforeachdb '

    IF ''?'' IN (''tempDB'') -- IN (''master'', ''model'', ''msdb'', ''tempdb'')

    RETURN

    INSERT INTO #t_nodb

    SELECT ''?''

    WHERE

    NOT EXISTS(SELECT 1 FROM [?].sys.extended_properties)

    '

    SELECT *

    FROM #t_nodb

    ORDER BY dbname

    DROP TABLE #t_nodb

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.