-
Drop User with Msg 15138?
Hi: I try to drop a user with following error
drop user TestUser
Msg 15138, Level 16, State 1, Line 1
The database principal owns a schema in the database, and cannot be dropped.
Then I tried:
select * from information_schema.schemata
where schema_owner = 'TestUser'
CATALOG_NAME SCHEMA_NAME SCHEMA_OWNER
---------------- ------------- ------------
DB_Installation db_datareader TestUser
(1 row(s) affected)
Drop schema TestUser
Msg 15151, Level 16, State 1, Line 1
Cannot drop the schema 'TestUser', because it does not exist or you do not have permission.
any idea?
thanks
-D
-
Change schema owner to other db user then drop TestUser.
-
Hi Rmiao:
Can I change the schema owner with t-sql? or a system proc?
I guess system tables since SQL 2005 coming out, could not be modified directly?
thanks lot for your help.
-D
-
I want to change the schema_owner from TestUser to dbo.
I have tried use
Alter authorization on object::db_datareader to schema owner
it failed.
thanks
-D
-
Try this:
Alter authorization on schema::db_datareader to dbo
-
Hi Rmiao:
It works!
thanks for your help.
-D
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|