• You may have already seen this link, but here it is; it describes an alternative way to what you are trying to do, and complications that come with it:

    http://www.eggheadcafe.com/software/aspnet/30323724/how-can-i-see-what-permissions-view-server-state-has.aspx

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]