Monday, March 26, 2012

Problems with sp_droplogin in SQL 2005

I have a script that must run in both SQL 2005 and SQL 2000. So beforehand,I want to tell
that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
I'm currently logon on the SQL server (DEVDSL1) using the local administrator account.
When I attempt to run:
EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
I receive the following error message:
Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
'DEVDSL1\LCL ADS Service' is not a valid login or you do not have permission.
However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no problem.
What could possibly be the rason why "sp_droplogin" do not work?
> What could possibly be the rason why "sp_droplogin" do not work?
sp_drop_login is intended to be use only be used for SQL-authenticated
logins, although SQL 2000 apparently didn't enforce the requirement. Use
sp_revokelogin to remove Windows-authenticated logins. That should work in
both versions.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gaetan Simard" <gaetan.simard@.eds.com> wrote in message
news:ms1fv19mkrc8m9ri54st01bv3crc8901n8@.4ax.com...
>I have a script that must run in both SQL 2005 and SQL 2000. So
>beforehand,I want to tell
> that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
> The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
> I'm currently logon on the SQL server (DEVDSL1) using the local
> administrator account.
> When I attempt to run:
> EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
> I receive the following error message:
> Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
> 'DEVDSL1\LCL ADS Service' is not a valid login or you do not have
> permission.
> However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no
> problem.
>

No comments:

Post a Comment