Today I needed to replace some SSIS configuration values in the database. I used this script to generate the update statements. The update statements replaces the old sql provider 2008 to 2012 and relaces a old instance name to a new one.
declare @SqlInstance_old nvarchar(100) = 'INSTANCE1' declare @SqlInstance_new nvarchar(100) = 'INSTANCE2' declare @SqlProvider_old nvarchar(50) = 'SQLNCLI.1' declare @SqlProvider_new nvarchar(50) = 'SQLNCLI11.1' -- Generate update script select QUOTENAME(TABLE_NAME) as table_name, 'update tbl set ConfiguredValue = REPLACE(REPLACE(ConfiguredValue,'''+@SqlInstance_old+''','''+@SqlInstance_new+'''),'''+@SqlProvider_old+''', '''+@SqlProvider_new+''') FROM '+QUOTENAME(table_catalog)+'.'+QUOTENAME(TABLE_SCHEMA)+'.'+QUOTENAME(TABLE_NAME)+' as tbl WHERE ConfiguredValue like ''Data Source=%'' and ConfiguredValue like ''%'+@SqlInstance_old+'%'''+char(10)+'GO'+char(10) from information_schema.columns as c where column_name = 'ConfiguredValue' -- Generate check script select 'SELECT * FROM '+QUOTENAME(table_catalog)+'.'+QUOTENAME(TABLE_SCHEMA)+'.'+QUOTENAME(TABLE_NAME)+' WHERE ConfiguredValue like ''Data Source=%'' and ConfiguredValue not like ''%'+@SqlInstance_new+'%''' from information_schema.columns as c where column_name = 'ConfiguredValue'