Given Windows Server 2008 R2, in which service accounts use a non-English display language, with SQL Server 2008, the following Transact-SQL statement fails:
CREATE LOGIN [NT AUTHORITY\NETWORK SERVICE] FROM WINDOWS ...
with the following error:
Windows NT user or group "NT AUTHORITY \ NETWORK SERVICE" was not found. Check the name again.
(or the same non-English message for service accounts, depending on the context).
The same statement succeeds if the service accounts use English as their display language.
The reason seems clear: for example, in the German system, the display name for this account is NT-AUTORITÄT\NETZWERKDIENST , and the name NT AUTHORITY\NETWORK SERVICE (with a space) is not recognized. Also, the non-localized name NT AUTHORITY\NETWORKSERVICE (without space) does not work.
My question is: how do I rewrite the above expression so that it works regardless of the display language? Or am I forced to find out the localized name (in InstallScript in my case)? Then i can use
CREATE LOGIN [NT-AUTORITÄT\NETZWERKDIENST] FROM WINDOWS
which is working...
sql-server tsql windows-server-2008-r2 locale
Marnix Klooster Jun 27 '11 at 17:15 2011-06-27 17:15
source share