Forums.ATC.no

Teknisk => Generelt teknisk => Emne startet av: ATC på 29. Mai 2009, 07:44 am

Tittel: SQL Server 2005: Map login-user to an existing (orphaned) database-user
Skrevet av: ATC29. Mai 2009, 07:44 am
When migrating a database from one SQL Server to another, the database itself will contain database-users with no corresponding login-user.

Attempting to "map" a new login-user to one of those existing (orphaned) database-users will FAIL because "the database-user already exists" (sic)
Tittel: [Solved] SQL Server 2005: Map login-user to an existing (orphaned) database-user
Skrevet av: ATC29. Mai 2009, 07:44 am
See http://www.mssqltips.com/tip.asp?tip=1590 for detailed information. The short version:

USE DatabaseName
GO

sp_change_users_login @Action='update_one',
@UserNamePattern='DatabaseUser1',
@LoginName='LoginUser1'
GO

Using attach/detach for migration is pretty useless without this, so why did they not implement this in the management GUI??