Where to find msdb.dbo.sp_send_dbmail stored procedure in SQL Server

I need to see the stored procedure code msdb.dbo.sp_send_dbmailin SQL Server. Can someone tell me where to look for the stored procedure in SQL Server Management Studio 2008.

+5
source share
3 answers

Right there:

enter image description here

As the name already tells you - it is in the database msdb(which is under System Databases), and the stored proc can be found inProgrammability > System Stored Procedures

+10
source
USE msdb;
GO

sp_helptext 'dbo.sp_send_dbmail';

OR

USE msdb;
GO

SELECT definition 
    FROM sys.sql_modules 
    WHERE object_id = OBJECT_ID('dbo.sp_send_dbmail');
+5
source

In node object explorer to expand your instance ...

Databases -> System Databases -> msdb -> Programmability -> 
              Stored Procedures -> System Stored Procedures

Or (seeing Joe's answer) one non-user interface

use msdb;

SELECT object_definition(object_id('dbo.sp_send_dbmail')) 
AS [processing-instruction(x)] FOR XML PATH('')
+3
source

All Articles