Reputation: 129
I need to look at the code for stored procedure msdb.dbo.sp_send_dbmail
in SQL Server. Could someone tell me where to look for the stored procedure in SQL Server Management Studio 2008.
Upvotes: 10
Views: 33038
Reputation: 754220
Right there:
As the name already tells you - it's in the msdb
database (which is under the System Databases
), and the stored proc can be found under Programmability > System Stored Procedures
Upvotes: 20
Reputation: 452947
From the Object Explorer node for your instance expand...
Databases -> System Databases -> msdb -> Programmability ->
Stored Procedures -> System Stored Procedures
Or (having seen Joe's answer) one non UI method
use msdb;
SELECT object_definition(object_id('dbo.sp_send_dbmail'))
AS [processing-instruction(x)] FOR XML PATH('')
Upvotes: 5
Reputation: 135729
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');
Upvotes: 8