In SQL Server, we can setup multiple email configurations out of which only some were set to default.
I have tried using the following query to get the list of accounts:
select *
from msdb.dbo.sysmail_profile p
join msdb.dbo.sysmail_profileaccount pa on p.profile_id = pa.profile_id
join msdb.dbo.sysmail_account a on pa.account_id = a.account_id
join msdb.dbo.sysmail_server s on a.account_id = s.account_id
Is there any way to identify the default mail configuration profile?
Best Answer
Add a join to
msdb.dbo.sysmail_principalprofile
and check theis_default
column to identify the default profile: