|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, September 12, 2009 9:12 PM
Points: 65,
Visits: 224
|
|
HI All,
I would like to change the default schema details of all the logins created Could yoy please specify how do i find out the schema details and also i would like to change all the objects default schema to DBO
Regards' Smm
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 5:38 AM
Points: 870,
Visits: 858
|
|
shine.mm (4/1/2008) HI All,
I would like to change the default schema details of all the logins created Could yoy please specify how do i find out the schema details and also i would like to change all the objects default schema to DBO
Regards' Smm
What schema details do you want to know exactly?
To change the default schema:
ALTER USER Mary51 WITH DEFAULT_SCHEMA = dbo To change objects to the default schema use:
ALTER SCHEMA dbo TRANSFER fully_qualified_object_name Hope that helps.
Karl source control for SQL Server
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, September 12, 2009 9:12 PM
Points: 65,
Visits: 224
|
|
Hi, What i would need is i would like to know each databases,Which are the Objects(Tables,Stored Procedures Etc.)not belong to the schema DBO. Fist i need to know which are the objects not belong to DBO
Then i would like to change the schema of this objects to DBO
Please help me Smm
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 5:38 AM
Points: 870,
Visits: 858
|
|
shine.mm (4/2/2008) Hi, What i would need is i would like to know each databases,Which are the Objects(Tables,Stored Procedures Etc.)not belong to the schema DBO. Fist i need to know which are the objects not belong to DBO
Then i would like to change the schema of this objects to DBO
Please help me Smm
This query will give you objects in a single database that do not belong to dbo. I've also constructed the command you'd need to run to transfer the object to a different schema.
select schema_name(schema_id), name, command = 'ALTER SCHEMA dbo TRANSFER [' + schema_name(schema_id) + '].[' + name + ']' from sys.objects where schema_name(schema_id) <> 'dbo' and type in('U','P','V', 'FN','TF','IF')
Karl source control for SQL Server
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, September 12, 2009 9:12 PM
Points: 65,
Visits: 224
|
|
hi,
Is there any method to find out Database users which do not have DBO as their default schema.
Any query
Smm
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, October 18, 2012 12:50 AM
Points: 174,
Visits: 315
|
|
You can use the following script for a specific database -
SELECT * FROM sys.database_principals WHERE [type] IN ('U','S') AND ISNULL(default_schema_name,'')<>'dbo'
Chandrachurh Ghosh DBA – MS SQL Server INFOSYS Limited Quality is not an act, it is a habit.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, September 12, 2009 9:12 PM
Points: 65,
Visits: 224
|
|
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
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, September 12, 2009 9:12 PM
Points: 65,
Visits: 224
|
|
HI chandru,
I posted one topic ,could you please help me
|
|
|
|