sp_change_users_login @Action='update_one', @UserNamePattern='itai', @LoginName='itai'
GO
Maps an existing database user to a SQL Server login.
@Action can be:
- Auto_Fix - Links a user entry in the sys.database_principals system catalog view in the current database to a SQL Server login of the same name.
- Report - Lists the users and corresponding security identifiers (SID) in the current database that are not linked to any login.
- Update_One - Links the specified user in the current database to an existing SQL Server login.
No comments:
Post a Comment