How can we help you today? How can we help you today?

PE006 (TABLE HINT is used)

Would like this to be more granular.

When doing reporting I use the WITH (NOLOCK) to avoid locks on tables.

I would like to be able to disable specific warnings about specific hints.
BrienKing
0

Comments

6 comments

  • RichardL
    Hi @BrienKing

    Thanks again for your post.

    This is not a feature that we are currently planning on implementing.

    You could make the suggestion on the uservoice page in the link below though, so that it can be considered if enough people want it.

    https://redgate.uservoice.com/forums/94413-sql-prompt
    RichardL
    0
  • jojojo
    Oh boy, this is annoying. All my scripts will be full of squiggly lines because of WITH(NOLOCK) hints... I thought this is best practice, not something you would flag
    jojojo
    0
  • Mick_Ayling
    I agree. This is super annoying. My DBA would pop an artery if I ran scripts without NOLOCK. I really devalues SQL Prompt as a productivity tool.
    Mick_Ayling
    0
  • ramanah
    I wish I could go back to older version of redgate. This is annoying.
    ramanah
    0
  • TomW
    Hi @BrienKing @Mick_Ayling @jojojo and @ramanah

    Currently, SQL Prompt does not allow for exceptions to be defined for specific code analysis rules. However, one potential option is to modify the code analysis settings to your own preferences. This can be done by clicking SQL Prompt -> Manage Code Analysis Rules... From there, you can enable or disable rules to suit your particular needs.

    You can even save different sets of code analysis rule settings tailored to specific scenarios, such as when you're dealing with reporting and perhaps don't want code analysis to flag up your use of table hints. This can be done by clicking Save As...  You can then change which set of code analysis settings Prompt uses by using the file selector in the top right of the code analysis settings screen.

    If you would like to disable rules on specific lines of SQL code, would it be possible to vote on the following UserVoice request:
    https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/32531393-code-analysis-disable-rule-for-specific-cases

    If these solutions don't work for you, could you provide some more information so that we fully understand your needs?

    I hope this helps!

    Kind Regards,

    Tom Walsh
    TomW
    0
  • langfod
    How would one keep Table Hints enabled but ignore the annoying NOLOCK warning?
    langfod
    0

Add comment

Please sign in to leave a comment.