5

First off i would like to appologise if i sound stupid as i do not have much knowladge of SQL Server.

I have recently started a project working with SQL Server 2008 R2. I have access to the database using Windows Authentication. Once logged in i can access all of the databases etc... My problem is, for my user DOMAIN/Glen i would like to add a default schema for one of the databases. I have changed the Default schema for 'DOMAIN\Glen' within the users section under the database in question however whenever i run a script without the schema prefix on the table it will not run.

I have been looking around and trying some things out and to my knowladge i am for some reason using the SA account and not the DOMAIN\Glen login.

If anyone could help me change my Loged in user from SA to DOMAIN\Glen that would be a great help.

Thanks

Boldonglen


EDIT

When i am accessing the database directly on the server it is logging me in as DOMAIN\Glen but when i am accessing it from my computer it is logging me in as SA.


EDIT 2

Also when i connect to SQL Server on the server normally i am getting the default schema of the one i have added however if i run SQL server on the server as an administrator i am getting the default schema of dbo.


Any Ideas?

0

1 Answer 1

4

DEFAULT_SCHEMA is ignored if the user is a member of the sysadmin fixed role. If DOMAIN\Glen is in the sysadmin role, the default schema is always dbo and you have to explicitly use the schema name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.