Sql-server – n easy way to update connection strings to a database moved to a different instance

connectionssql-server-2008-r2

I have created a new instance of SQL Server 2008 r2 and exported my database to the new instance. Then I realized that the connection string for all of my datasets still point to the original database. Is there an easy way to update the connection string for each of the datasets?

This also brings a question on deployment. Each customer that purchases the software would have a different connection string. Can you point me to some documentation that would explain how to handle this scenario?

Best Answer

Directory Service

One way to deliver a connection string is through a directory service such as LDAP.

If every human and app looks up the connection string in the directory service, then you have only one place to update when a change happens.

Programming environments often provide access to directory services. For example, Java offers JNDI.