An annoying bug in Database Mail Configuration Wizard
Looks like a sneaky bug made its way from SQL Server 2005 CTP to SQL Server 2008 R2 SP1 almost unnoticed, or, at least, ignored by Microsoft.
Imagine that you installed a new SQL Server instance (let’s call it “TEST”) and you want Database Mail configured in the same way as your other instances. No problem: you navigate the object explorer to Database Mail, start the wizard and then realize that you don’t remember the parameters to enter.
Not a big deal: you can copy those parameters from the server “PROD” that you configured last year.
You start the wizard on “PROD” and keep this window open to copy the parameter values in the “TEST” dialog.
OK, done? You just have to click “Finish” and… whoops!
This is the error you get when you try to apply the settings:
Wait: you don’t have a “dba_notify” account on server “TEST” yet. This error message was generated on PROD instead.
Looks like MS developers coded this dialog assuming that just one of these was open at a time and probably used an application-scoped global variable to store the Database Mail settings. Not only: the Database Mail Wizard looses its database context and points to a different instance.
I found a Connect item reporting the issue, dating back to July 2005:
Here is another one from 2006:
I haven’t tried on Denali CTP3 yet, but I would not be surprised if I found it to be still broken.
Until Microsoft decides to fix it, if you want to copy the Database Mail Settings from another server, start the Database Mail Wizard from a separate SSMS instance, or your settings can get totally screwed up.