A little something about everything

internet marketing and website development made simple..

Moving database from MS SQL 2000 to 2005 or 2008 | Error / User / Roles / Delete

In order to fix this bug you can simply run this command on the effected database after you have used the backup (sql2000) / restore sql2005/2008) or detach attach methods.

command to run:

 

Replace "dbusername" with the problem user account. both should be the same.

This will remove the ghost user from the sql 2000 server and replace it with the new user on your sql 2005 / 2008 server. Be sure to have the user created before running this command.

Errors associated with this are as follows:

"login name must be specified Database user"

"The database principal owns a schema in the database, and cannot be dropped"

"user group or role already exists in the current database"

"can't delete sql user in database"