Maxime Ozenne Maxime Ozenne - 11 months ago 64
SQL Question

System Stored Procedure Missing

I'm beginning in SQL Server dev. I'm working with 2 servers, one has a System Stored Procedure called "sp_send_dbmail" from the dbo schema on the System Database msdb but the second hasn't it.

When something is missing on one of theses servers, I just right click on a function/table/view then I click on "Script as ... CREATE", then I right click on the script and do Connections > Change Connections. I connect on the other server then I execute the create script to create the missing element from the first server to the second one.

But here I want to copy a System Stored Procedure, but I can't do "Script as ... CREATE" on a System Stored Procedure...

How can I do the trick ?

Thanks for your attention.

use msdb
exec  sp_helptext sp_send_dbmail

use this statement in sql to get text of stored procedure