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