I migrated copies of a database to a test server, but I cannot log on. My
admin account needs to be dropped and readded but every time I run
sp_dropuser in query analyzer I get the error :
Msg 15183, level 16, state 1, ...
"the user owns objects in the database and cannot be dropped."
then a list of the objects (EG TMP_SYSA_1234) is displayed.
How can I delete these objects? I assume then I will be able to delete the
user and recreate him.On 20 mar, 19:09, totoro <tot...@.discussions.microsoft.com> wrote:
> I migrated copies of a database to a test server, but I cannot log on. My
> admin account needs to be dropped and readded but every time I run
> sp_dropuser in query analyzer I get the error :
> Msg 15183, level 16, state 1, ...
> "the user owns objects in the database and cannot be dropped."
> then a list of the objects (EG TMP_SYSA_1234) is displayed.
> How can I delete these objects? I assume then I will be able to delete the
> user and recreate him.
Hi,
You're perfectly right... This error means that some objects are still
owned by this user.
In order to drop each object, you will first need to know what kind of
objects are owned by the user you would like to delete. Then, you'll
be able to run the correct drop commands in the query analyser...
As an example, here are some usual drop commands :
DROP TABLE [schema].[Table name]
DROP VIEW [schema].[View name]
DROP PROCEDURE [schema].[Procedure name]
.=2E.
Whenever all the objects owned will be dropped, you'll be able to use
the sp_dropuser procedure.
Hope this helps,
C=E9dric Del Nibbio
MCTS SQL Server 2005
MCSD .NET
MCT
http://cedric-delnibbio-sql.blogspot.com|||thank you, Cedric
"Cédric Del Nibbio" wrote:
> On 20 mar, 19:09, totoro <tot...@.discussions.microsoft.com> wrote:
> Hi,
> You're perfectly right... This error means that some objects are still
> owned by this user.
> In order to drop each object, you will first need to know what kind of
> objects are owned by the user you would like to delete. Then, you'll
> be able to run the correct drop commands in the query analyser...
> As an example, here are some usual drop commands :
> DROP TABLE [schema].[Table name]
> DROP VIEW [schema].[View name]
> DROP PROCEDURE [schema].[Procedure name]
> ...
> Whenever all the objects owned will be dropped, you'll be able to use
> the sp_dropuser procedure.
> Hope this helps,
> Cédric Del Nibbio
> MCTS SQL Server 2005
> MCSD .NET
> MCT
> http://cedric-delnibbio-sql.blogspot.com
>sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment