Home Forums SQL Server 2005 Administering How to find out the Objects Defacults Schema Details RE: How to find out the Objects Defacults Schema Details

  • Thanks alot,Also I would need couple of details ,could you help me

    ---

    This is what I needed,

    1)Objects which do not belong to DBO

    This is the query we are using to find out

    select schema_name(schema_id)as ObjectName, name,type,type_desc from sys.objects

    where schema_name(schema_id) <> 'dbo'

    and type in('U','P','V', 'FN','TF','IF','PK','UQ')

    go

    2)Database users which do not have DBO as their default schema

    SELECT *

    FROM sys.database_principals

    WHERE [type] IN ('U','S')

    AND ISNULL(default_schema_name,'')<>'dbo'

    We would like to create a report out of it and let a procedure run in every instance on a daily basis. The procedures should write the information into seperate tables in theOne of DB(Like ABC)database

    I need to have the Sp in one Database and it needs to check all the Database and fetch the details into separate tables as per the database name

    Could you please help me