468,242 Members | 1,436 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

How to synch renamed NT account with SQL Server 2005

We have NT accounts with access to our SQL Server 2005 database.

Infrastructure are going to rename the NT Accounts and I need to
secure a *no impact* scenario for our users. I'm reading here about
SIDs and syslogins but not 100% up on this area.
What is the best way to update / synch the NT account names within
SQL
Server?
Thanks!
Sep 8 '08 #1
1 1411
Jules (ju***********@james-chapman.co.uk) writes:
We have NT accounts with access to our SQL Server 2005 database.

Infrastructure are going to rename the NT Accounts and I need to
secure a *no impact* scenario for our users. I'm reading here about
SIDs and syslogins but not 100% up on this area.
What is the best way to update / synch the NT account names within SQL
Server?
Get new and old names into a mapping table. Then run:

SELECT 'ALTER LOGIN ' + quotename(oldname) + ' WITH NAME = ' +
quotename(newname)
FROM tbl

Copy, paste and run result. If the SID also changes, this too can be
addressed with ALTER LOGIN.

If you need to put this in a script, you can run a cursor over the
the result set and then EXEC() each row.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Sep 8 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by moko | last post: by
4 posts views Thread by Brent White | last post: by
reply views Thread by CESAR DE LA TORRE [MVP] | last post: by
7 posts views Thread by =?Utf-8?B?UGV0ZXI=?= | last post: by
2 posts views Thread by Bill E. | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.