Re: Alter User for domain user



Erland Sommarskog <esquel@xxxxxxxxxxxxx> wrote in
news:Xns9A97520A95F6Yazorman@xxxxxxxxx:

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.


Yes, I know that all users have a default schema; getting a non-dbo
default schema is what I am trying to accomplish. I am NOT the dbo, but
my default schema remains at dbo, reegardless of what I do.

I want my default schema to be what I have set it to with "alter user"
just as in your example below.

I see that the IS group, which I am a member of, has the sysadmin fixed
role on the server. Maybe that's the problem.

My specific userid has the "public" role on the server, and additional
roles on the database where I am trying to change my default schema away
from dbo to something else.

Is the my group membership the source of the problem? Again, I don't
see that it's documented that a member of the sysadmin fixed role can't
have a non-dbo default schema. (Not the dbo role, but sysadmin.)


David Walker


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




.



Relevant Pages

  • RE: Migrating from Win2k DCs to Win2k3 DCs; ADPrep question
    ... Windows Server 2003 CD, we need to confirm the following things in Q314649 ... Exchange 2000 Schema Changes Are Installed Before You Run the ... Windows Server 2003 adprep /forestprep Command ...
    (microsoft.public.windows.server.migration)
  • Re: upgrade a Windows 2003 DC to R2
    ... MS-KBQ293783_Cannot Upgrade Windows 2000 Server to Windows Server 2003 with ... > when doing adprep forestprep. ... > "attributeId" attribute value for objects defined in Windows 2000 schema ...
    (microsoft.public.windows.server.active_directory)
  • Re: adprep /forestprep failure
    ... We raised the functional level to Windows ... We did have another Windows 2000 Server SP 4 domain controller ... Adprep was unable to extend the schema. ... is the Schema Owner, but is deleted. ...
    (microsoft.public.windows.server.active_directory)
  • Re: 2k8 AD from 2k AD
    ... The schema update will work or not and if not you get an error message to fix the problem. ... you can restore the server from system ... if the upgrade fails you can completely ... You need to be aware that the minimum DFL for Windows ...
    (microsoft.public.windows.server.active_directory)
  • Re: Feasability
    ... you add machine accounts to groups in windows 2000 by ... extending your AD schema. ... If you will be planning on creating Server Locator Points or Management ...
    (microsoft.public.sms.admin)