A couple of days ago I posted a stored procedure (sp_GetAGInformation) which queried multiple DMVs to pull together a bunch of Availability Group information. If you took a look at the code you would see that it used a couple of CTEs (Common Table Expressions). CTEs are a great way to do recursive work, and…