Search code examples
visual-studio-2008localizationsql-server-2008-expressadministrator

Testing regional settings (localization) in SQL Server 2008 Express


I'm installing SQL Server 2008 Express along with my application, via a bootstrapper.

I need to give users admin privileges for the SQL Server, so an ordinary user can create and manipulate DBs.

I was doing it via the bootstrapper with this:

<Command PackageFile="SQLEXPR32_x86_ENU.EXE"
         Arguments='/q /hideconsole /action=Install /features=SQL 
                    /instancename=DUBOCALC /enableranu=1 
                    /sqlsvcaccount="NT Authority\Network Service" 
                    /SQLSYSADMINACCOUNTS="Builtin\Users" 
                    /skiprules=RebootRequiredCheck'
         EstimatedInstalledBytes="225000000"
         EstimatedInstallSeconds="420">

But I need to do it now depending on the regional settings, as this wouldn't work for a dutch system for example, as they don't user BUILTIN\Users but INGEBOUWD\Gebruikers.

I resolved to do this where my DB is created, using:

SecurityIdentifier sidservice = new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null);
NTAccount acct = (NTAccount)sidservice.Translate(typeof(NTAccount));
string sqlsvcaccount = acct.Value.ToString();

SecurityIdentifier sidadmin = new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null);
NTAccount adminacct = (NTAccount)sidadmin.Translate(typeof(NTAccount));
string SQLSYSADMINACCOUNTS = acct.Value.ToString();

string cmdStr = "EXEC sp_grantdbaccess '" + SQLSYSADMINACCOUNTS + "' " + 
                "EXEC sp_addrolemember 'db_owner', '" + SQLSYSADMINACCOUNTS + "'" + 
                "EXEC sp_addsrvrolemember " + SQLSYSADMINACCOUNTS + "', 'dbcreator' ";
command = new OleDbCommand(cmdStr, conn);
command.ExecuteNonQuery();

But now I need to test this, but my system is in English and I don't have access to a Dutch or any other language OS :-)

Is there any other way I can test this?

Thanks a lot in advance!


Solution

  • You have to install a MUI Language Pack. The required tasks does depend on your target windows edition. It's a good idea to use a virtual machine image for this. Starting point: http://en.wikipedia.org/wiki/Multilingual_User_Interface