c# - How to check if SQL Server Management Studio is installed on a system programmatically? -


i need find whether sql server management studio installed on system or not. need specially when instance of sql server express installed on system installing visual studio no management studio installed on system.

for more information, can find instances of sql server installed on system need understand management studio installed on system or not.

you can check registry key , see if returns null:

private registrykey _regsql = registry.localmachine.opensubkey             (@"hklm\software\classes\applications\sqlwb.exe", false);  if (_regsql == null) //if it's null  sql server management not installed {    //do } 

also 2 more registry locations can check:

hklm\software\microsoft\microsoft sql server\ssmsee software\microsoft\microsoft sql server\90\tools\clientsetup 

edit

according this documents, while using address software\microsoft\microsoft sql server\90\tools\clientsetup change the number part (90) based on versions want check:

90   | sql server 2008 100  | sql server 2008 r2 110  | sql server 2012 120  | sql server 2014  130  | sql server 2016 140  | sql server 2017 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -