SharePoint 2010 Connection String Registry Key

If you ever come across a need to know the connection string for your SharePoint 2010 configuration database you can locate it in the servers registry.

The key is called dsn and it is located at:

My Computer
HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Shared Tools
Web Server Extensions
14.0
Secure
ConfigDb

In one specific case I had a database that supported a few SharePoint customizations.  I wanted to keep that database on the same SQL Server instance that SharePoint was using.  Instead of hard-coding the connection string the SharePoint customization reads the ConfigDb registry key and then replace the database name with my custom database.   Simple and easy way to determine the database location at runtime.

And as a reminder, do not modify any of the SharePoint databases directly.  This will put your environment into an unsupported state.  It is also recommended that you do not modify this registry key.  You should not modify this key as an attempt to move the SharePoint databases to another SQL server.  Using a SQL Alias when building SharePoint is the only supported method for pointing the SharePoint farm to another SQL instance.

0 thoughts on “SharePoint 2010 Connection String Registry Key

Leave a Reply