Home   Wordpress   Log in

Archive for February, 2009

User Already Exists in the Current Database?

February 20th, 2009 by admin | 3 Comments | Filed in Database

Have you ever had a time when you needed to move a SQL database to a new server… made your backup… restored to new server… Go to setup the SQL user with permissions and get this…

Create failed for User ‘myuser’. (Microsoft.SqlServer.Smo)
User, group, or role ‘myuser’ already exists in the current database. (Microsoft SQL Server, Error 15023)

Huh… User already exist in database???

This is because the user in the database is orphaned. This means that there is no SQL login id or password associated with the database user.

This is really easy to correct in SQL 2000 SP3 or greater.

First, make sure that this is the problem. This will lists the orphaned users:

EXEC sp_change_users_login 'Report'

If you already have a login id and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user'

If you want to create a new login id and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'

(HT: FileFormat.info)

Under the Bus

February 13th, 2009 by admin | No Comments | Filed in .NET, Database, Personal

What happens when a database team is moving databases and the development team puts up a maintenance page to the company while the move occurs…

UnderTheBus

That’s right… they put me under the bus!

Just a little Friday humor… BTW… This really happened yesterday. ;-)

Download Full Movie Online Hytrin