• PFlorenzano-641896 (12/11/2013)


    Hello Jonathan,

    Thank you for providing this article. I have a question on how to add this functionality to an 'existing' database within my organization.

    For instance, the code you provided within the article works great when creating a new database, but how would this work with an existing database? I've enabled service broker on the database, but for some reason, no email are coming through when running an execution loop test.

    Thanks,

    Pete

    If you create this outside of msdb, you have to use certificate based security to sign the activation stored procedure as explained in this article:

    Using a Certificate Signed Stored Procedure to Execute sp_send_dbmail[/url]

    As explained in the comments in the code, I create all this stuff in msdb so that we don't have to deal with managing cross database security and certificate signatures.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]