Skip to content

Instantly share code, notes, and snippets.

@tkMageztik
Last active October 11, 2015 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkMageztik/3891597 to your computer and use it in GitHub Desktop.
Save tkMageztik/3891597 to your computer and use it in GitHub Desktop.
Get all local mssql server instances.
private string[] getInstances()
{
Microsoft.Win32.RegistryKey rk;
rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server");
string[] s;
s = ((string[])rk.GetValue("InstalledInstances"));
return s;
}
@tkMageztik
Copy link
Author

Obtiene las instancias instaladas de SQL Server, testeado hasta Windows 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment