How can I join msdb.dbo.sysalerts to msdb.dbo.sysoperators? I am using SQL Server 2008 R2 and I want to create a script of my jobs.

I need to find all objects that exist in one job.

To achieve this goal, I get all operators with this query:

SELECT * FROM msdb.dbo.sysoperators


and I can find all Alerts with this query:

SELECT * FROM msdb.dbo.sysalerts


Each alert has several operators. 

I want to join the two tables together.


How can I get all operators for all alerts?
You can use this query:

SELECT * 
FROM msdb.dbo.sysalerts AS Ale
INNER JOIN msdb.dbo.sysnotifications AS Noti ON Ale.id = Noti.alert_id
INNER JOIN msdb.dbo.sysoperators AS Ope ON Noti.operator_id = ope.id