ms sql: update sql login names

if you have sql logins that are based on AD users and the AD username changes at some point, these changes are not updated automatically in ms sql. i’ve read various posts that claim that restarting the sql service or the server entirely will cause the sql login info to update. i have yet to see this actually happen.

when there’s this mismatch between sql login names and AD usernames, functionality doesn’t suffer, but the sql error logs will grow to massive proportions. the Application log in windows event viewer will likewise be flooded with sql errors.

since ms sql 2005, there has been a sql command to resolve this issue:
ALTER LOGIN [domain\user] WITH NAME = [domain\user];

i have tested this out and it works great.

source:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/a41f785a-fe6e-4c87-b90f-e3d8dd4a4e8a/renaming-domain-user-accounts-and-sql

This entry was written by resinblade , posted on Wednesday January 08 2014at 06:01 pm , filed under IT . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Comments are closed.