use msdb GO DROP PROC MailTim GO CREATE PROC MailTim @Subject NVARCHAR(100),@Body NVARCHAR(MAX) AS BEGIN Exec dbo.sp_send_dbmail @profile_name='MailToTim', @recipients='mingyongcheng@qq.com', @subject=@Subject, @body=@Body
END GO exec MailTim '20120901','Hi,Tim'