Re: Alter User for domain user
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 06 May 2008 15:30:07 -0700
David Walker (none@xxxxxxxx) writes:
I still would like for my username to have a default schema. When I
connect to the server with Windows Authentication, the default schema is
not mapped. (I used to have the dbo role, but that's not the case any
more. I know that a user with the dbo role doesn't have a default
schema.)
All users have a default schema, including dbo. But you can't change
the default schema for dbo to anything else than dbo.
I'm not really sure what your problem may be, as I don't know all your
steps. But I did a test, and I was indeed able to set up a default
schema different from dbo for a Windows login. Here is my test script:
create login [YAZORMAN\Laban] from windows
create user [YAZORMAN\Laban]
go
alter user [YAZORMAN\Laban] with DEFAULT_SCHEMA = thatschema
go
create table hyfs(a int NOT NULL)
create table thatschema.hyfs (b int NOT NULL)
GRANT SELECT ON SCHEMA::thatschema TO [YAZORMAN\Laban]
go
EXECUTE AS LOGIN = 'YAZORMAN\Laban'
go
select * from hyfs -- Lists a result set with a column b
go
REVERT
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Alter User for domain user
- From: David Walker
- Re: Alter User for domain user
- References:
- Alter User for domain user
- From: David Walker
- Re: Alter User for domain user
- From: Tom Moreau
- Re: Alter User for domain user
- From: David Walker
- Re: Alter User for domain user
- From: Tom Moreau
- Re: Alter User for domain user
- From: David Walker
- Alter User for domain user
- Prev by Date: Re: SQL2005 non-administrator Service Account
- Next by Date: Set Sql Agent Proxy Account to Local Account
- Previous by thread: Re: Alter User for domain user
- Next by thread: Re: Alter User for domain user
- Index(es):
Relevant Pages
|