Scripting setup of database mail
问题 I've used the SQL Server 2008 GUI to set up database mail profiles & accounts on my test server, and I'd now like to duplicate those to our production database. Is there a way to generate a script to do this? 回答1: AFAIK, there isn't a way to necessarily script this from SSMS but you can create a transportable script in TSQL once and reuse it on all the servers. Here is a good example to get you started with this: USE [master] GO sp_configure 'show advanced options',1 GO RECONFIGURE WITH