Wednesday, 19 March 2014

Manage User Mapping With ALTER USER

I previously posted about how to use the SQL stored procs to auto fix a user.

This stored proc is going to be deprecated in new versions of SQL Server. So how do we map a user, we can use the ALTER USER function.

For Example:

EXEC sp_change_users_login 'Auto_Fix', 'username', NULL, 'password';

now becomes

ALTER USER [username] WITH LOGIN = [username], PASSWORD = 'password';

No comments: