Skrevet av Emne: SQL Server 2005: Map login-user to an existing (orphaned) database-user  (Lest 4410 ganger)

ATC

  • Gjest
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)



ATC

  • Gjest
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??