Showing posts with label logins. Show all posts
Showing posts with label logins. Show all posts

Sunday, March 25, 2012

Delete a user. Please help

Hi,
I hve been tring to delete a Login User form SQL 2000 and cant do it
I go to Security, Logins, find the user, right click and delete.
I then get a option that says "Removing this login will remove all
associated database users (if any)".
I say yes to that and then...
Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or
more databases- Drop the user or alisas before dropping the login.
Database name :DB1, DB2, DB, etc.
How can I get past this!
Thanks.
George.
Do what the error message say: Remove the users or aliases from the database as listed in the error
message.
If these are users, use sp_dropuser for if it is a SQL Server Login or sp_revokedbaccess if it is a
Windows Login.
If these are aliases (which i think it is, as EM doesn't remove them for you), use sp_dropalias.
The stored procedures I mentioned above are documented in Books Online.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George D. Lake" <NoSpam@.bla.com> wrote in message news:eJuY4$JJFHA.3340@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I hve been tring to delete a Login User form SQL 2000 and cant do it
> I go to Security, Logins, find the user, right click and delete.
> I then get a option that says "Removing this login will remove all associated database users
> (if any)".
> I say yes to that and then...
> Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or more databases- Drop the
> user or alisas before dropping the login.
> Database name :DB1, DB2, DB, etc.
>
> How can I get past this!
>
> Thanks.
> George.
>

Delete a user. Please help

Hi,
I hve been tring to delete a Login User form SQL 2000 and cant do it
I go to Security, Logins, find the user, right click and delete.
I then get a option that says "Removing this login will remove all
associated database users (if any)".
I say yes to that and then...
Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or
more databases- Drop the user or alisas before dropping the login.
Database name :DB1, DB2, DB·, etc.
How can I get past this!
Thanks.
George.Do what the error message say: Remove the users or aliases from the database as listed in the error
message.
If these are users, use sp_dropuser for if it is a SQL Server Login or sp_revokedbaccess if it is a
Windows Login.
If these are aliases (which i think it is, as EM doesn't remove them for you), use sp_dropalias.
The stored procedures I mentioned above are documented in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George D. Lake" <NoSpam@.bla.com> wrote in message news:eJuY4$JJFHA.3340@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I hve been tring to delete a Login User form SQL 2000 and cant do it
> I go to Security, Logins, find the user, right click and delete.
> I then get a option that says "Removing this login will remove all associated database users
> (if any)".
> I say yes to that and then...
> Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or more databases- Drop the
> user or alisas before dropping the login.
> Database name :DB1, DB2, DB·, etc.
>
> How can I get past this!
>
> Thanks.
> George.
>sql

Delete a user. Please help

Hi,
I hve been tring to delete a Login User form SQL 2000 and cant do it
I go to Security, Logins, find the user, right click and delete.
I then get a option that says "Removing this login will remove all
associated database users (if any)".
I say yes to that and then...
Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or
more databases- Drop the user or alisas before dropping the login.
Database name :DB1, DB2, DB, etc.
How can I get past this!
Thanks.
George.Do what the error message say: Remove the users or aliases from the database
as listed in the error
message.
If these are users, use sp_dropuser for if it is a SQL Server Login or sp_re
vokedbaccess if it is a
Windows Login.
If these are aliases (which i think it is, as EM doesn't remove them for you
), use sp_dropalias.
The stored procedures I mentioned above are documented in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George D. Lake" <NoSpam@.bla.com> wrote in message news:eJuY4$JJFHA.3340@.TK2MSFTNGP14.phx.gb
l...
> Hi,
> I hve been tring to delete a Login User form SQL 2000 and cant do it
> I go to Security, Logins, find the user, right click and delete.
> I then get a option that says "Removing this login will remove all asso
ciated database users
> (if any)".
> I say yes to that and then...
> Error 15174: Login 'XXXXXXX' is aliased or mapped to a user in one or m
ore databases- Drop the
> user or alisas before dropping the login.
> Database name :DB1, DB2, DB, etc.
>
> How can I get past this!
>
> Thanks.
> George.
>

Tuesday, February 14, 2012

default schema not working?

I am confused.

I added my NT account to the sql server logins for my sql server (2005), then I added a corresponding user account to my database. I then set my default schema. I connect to the database, and the default schema seems to be set to dbo.

Can anyone thing of a reason why this might be happening? Is there some sort of override if I have additional privledges on the server?

I appreciate any thoughts...

-Mike Graham

AH HA !!!

In the BOL, it says "you cannot change the default schema for a user that is mapped a windows group" - my account was in the administrators group which had been added to the logins for the sql server.

I remove the group and it started working without even closing the query window.

YES !!!!!!!!!!!!

|||

Ok - little more info:

I also noticed that if i am in the server role: sysadmin, the default schema assignment doesn't work, but if I remove myself, then it works.

|||

If you are a sysadmin, you are also a member of db_owner, so your default schema will be dbo.

The BOL quote refers to the fact that you cannot set a default schema for a database principal that is mapped to a Windows group, NOT that you cannot set it for a database principal who is mapped to a Windows account that belongs to some group.

So, what prevented the default_schema setting from working was the fact that you were a sysadmin.

Thanks
Laurentiu