0

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.

M. Ozn
  • 1,018
  • 1
  • 19
  • 42

2 Answers2

2
use msdb
go
exec  sp_helptext sp_send_dbmail

use this statement in sql to get text of stored procedure

Akshey Bhat
  • 8,227
  • 1
  • 20
  • 20
1

There is a system stored procedure called sp_send_dbmail that is installed when you configure Database Mail. It's possible that Database Mail has only been configured on one of the two servers you are working with.

Copying the sp_send_dbmail stored procedure to the other server will not enable Database Mail. You will need to follow the steps to enable Database Mail.

Ed Harper
  • 21,127
  • 4
  • 54
  • 80