• I can see this being a fun tool to play with, but seems like a drawn out process of using sp_send_dbmail. By the time I fill in all the variables, I'd just copy my results into a spreadsheet and send it as an attachment.

    Also, it seems like on line 43 you are referring to something that isn't built in this sp:

    "INSERT INTO #Fields ( field ) SELECT s FROM DBAAdmin.dbo.SplitString(@fieldlist,'|') WHERE zeroBasedOccurance = @j-2"

    I'm assuming you'd have to create a SplitString function first?