March 17, 2008 at 10:14 am
HELLO EVERY ONE,
to drop a user from database i followed below steps. but still i see error .
1. changed objects ownership (i did check table schema, routins. This database in SQL2000 Compatability.
select 'sp_changeobjectowner ''[' + table_schema + '].[' + table_name + ']'', ''' + 'DBO' + ''' go' from information_schema.tables where Table_schema = 'NEWOWNER' select 'sp_changeobjectowner ''[' + ROUTINE_schema + '].[' + ROUTINE_name + ']'', ''' + 'DBO' + ''' go' from information_schema.ROUTINESwhere ROUTINE_schema = 'NEWOWNER' /* This method uses the INFORMATION_SCHEMA views */SELECT * FROM INFORMATION_SCHEMA.SCHEMATAWHERE SCHEMA_NAME = 'newowner';GO
EXEC sp_dropalias 'userid'
EXEC sp_helprolemember )
i am checking this many ways but when i try to drop user it thoughs error again
Msg 15183, Level 16, State 1, Procedure sp_MScheck_uid_owns_anything, Line 17
The user owns objects in the database and cannot be dropped.
what piece of information missing here.
March 17, 2008 at 11:11 am
March 17, 2008 at 11:25 am
Try the following script to find whether or not this account owns any object.
SELECT su.uid, su.name, so.name FROM sys.sysusers su, sys.sysobjects so WHERE su.uid = so.uid AND su.uid <> 1 AND su.name = 'userName'
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply