Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Table creation with schema owner of current login windows ID. Expand / Collapse
Author
Message
Posted Thursday, November 19, 2009 12:02 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 12, 2012 12:23 PM
Points: 86, Visits: 225
Hi,
I have a problem...when i create any table or Stored Procedure it is going to create with my windows login like citi\ruslan.Employees
instead of
dbo.Employees
I know how to change it after creation but i want to know how i can fix it when i should create any object it should have dbo owner instead of my windows id.
Please help.
Post #821860
Posted Thursday, November 19, 2009 12:24 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 11, 2012 9:11 AM
Points: 48, Visits: 303
Try to create the objects using dbo i.e, dbo.objectname

Regards,
VRR
Post #821869
Posted Thursday, November 19, 2009 12:30 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 12, 2012 12:23 PM
Points: 86, Visits: 225
I have tried and it get created like windowid.dbo.tablename :)
Post #821875
Posted Thursday, November 19, 2009 9:50 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, November 05, 2013 9:37 PM
Points: 75, Visits: 189
This was happened because your NT login created with default schema with your login other than dbo.

Try to varify what's in default_schema_name:
SELECT * FROM
sys.database_principals
where name like '%<your login>%'

See what the default_schema_name is.
I believe the default_schema_name is your login.

Then ask your administrator to change your default schema in the database that you are trying to use, as you do not have permission to change the default schema.

He might have to use the following command.
USE <your database>
ALTER USER [<your nt login>] WITH DEFAULT_SCHEMA = dbo

Post #822086
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse