KoreSupport Logo

Welcome to KoreSupport's support center where you can submit support tickets and check on their progress.

Please use the links from the menu on the left to perform all your support needs.

HomeMaterial Advantage Generic FAQGeneralChange all e-mail addresses to single recipient (for testing)


12.1. Change all e-mail addresses to single recipient (for testing)


SYMPTOM

The e-mail addresses in the test system point to "live" e-mail addresses, which is unacceptable for testing.

 

CAUSE

When testing a new feature, patch or hot-fix, it is likely that any e-mail functionality would need to be restricted so as to *not* e-mail the assigned personnel with test approvals, work stack entries, etc...

 

RESOLUTION

The resolution is to simply set *all* e-mail addresses in the system to an address accessible only to the tester.

To do this, the following SQL Cursor should be run against the *TEST* database:

The SQL file has been attached for expedience.

NOTE: Change the e-mail address Trevor.Best@korecentric.com to the desired recipient address

print 'email addresses'

 

declare @email varchar(50)

declare @table_name sysname

declare @column_name sysname

declare @sql nvarchar(max)

 

set @email = 'trevor.best@korecentric.com'

set nocount on

set ansi_warnings off

 

declare csr cursor local for select table_name, column_name from information_schema.columns

where column_name like '%mail%' and data_type in ('varchar','nvarchar')

and (table_name like 'tbl%' or table_name like 'zstbl%')

 

open csr

fetch next from csr into @table_name, @column_name

while @@fetch_status = 0 begin

set @sql = 'update ' + @table_name + ' set ' + @column_name + ' = ''' + @email + ''' where ' + @column_name + ' is not null'

print @sql

exec sp_executesql @sql

fetch next from csr into @table_name, @column_name

end

close csr

deallocate csr

Downloads

This page was: Helpful | Not Helpful