April 1, 2008 at 4:50 am
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
April 1, 2008 at 5:12 am
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.
April 2, 2008 at 11:50 pm
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
April 3, 2008 at 12:48 am
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')
April 11, 2008 at 2:11 am
hi,
Is there any method to find out
Database users which do not have DBO as their default schema.
Any query
Smm
April 11, 2008 at 2:36 am
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
Ericsson India Global Services Limited
Quality is not an act, it is a habit.
April 11, 2008 at 6:17 am
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
April 11, 2008 at 6:19 am
HI chandru,
I posted one topic ,could you please help me
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply