How to avoid VIEW SERVER STATE permission error using SQL Doc?

BobGoodBobGood Posts: 16 Bronze 2
Are there settings for SQL Doc that avoid attempting to do operations that require VIEW SERVER STATE permissions?

We are developers (not DBAs) who do not have and will not be granted these permissions on our QA (or production) servers.

Our current .sqldoc file includes the following:

Bob Good


  • Good Afternoon!
    Unfortunately, there isn't workaround for this as it's one of the requirements:

    I do apologize for the inconvenience that this brings.

    Sean Quigley | Product Support Engineer | Redgate Software

    Have you visited our Help Center?

  • BobGoodBobGood Posts: 16 Bronze 2
    It is not credible that SQL Doc 5 fails where SQL Compare 13 succeeds. 
    For SQL Compare 13; VIEW DEFINITION is the only minimum permission needed.
    Even including the following option to exclude trusted assemblies, a VIEW SERVER STATE error was generated when SQL Doc submitted a select query against the sys.trusted_assemblies DMV.

    Option uri="http://sqldoc/project/selections/sections/trustedassemblies/include/" value="False"

    Defect or proposed feature request:
    SQL Doc should determine whether VIEW SERVER STATE permissions exist; and modify its behavior to not issue any DMV query requiring that permission.
    Where appropriate, in place of the parts of the documentation (nodes) for which the privileged DMVs are needed, a message stating the item cannot be documented because the user does not have view server state permissions.

    Alternative: an option to avoid privileged DMVs should be part of the .sqldoc project file. The difference between this option and that above is how the behavior is determined (by querying for the existence of permissions, or by a project file option). 
    Bob Good
  • BobGoodBobGood Posts: 16 Bronze 2
    BTW, the DMV sys.trusted_assemblies was introduced in SQL 2017 (I believe); so SQL Doc 5 must already have a mechanism to select which DMVs to use; and what documentation to produce based on version.

    It is not too much of a leap to include consideration of permissions in controlling the behavior of SQL Doc.
    Bob Good
  • rarifiedonerarifiedone Posts: 2 New member
    edited March 6, 2020 10:15PM
    Has there been an update to this?  My DBA said no when I requested View Server State permissions on our sql instance.  They want an explanation for why this permission is required
  • KenKKenK Posts: 1 New member
    Checking to see if there have been any updates.  I have the same issue with SQL Doc, but don't have any issues with SQL Compare.  

    Is there a specific object or section I can exclude to get around this error?  
Sign In or Register to comment.