By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

How to synch renamed NT account with SQL Server 2005

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.