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

Find unused variables and parameters

When I select Find unused variables and parameters, it identifies variables that are contained in strings and used in dynamic SQL statements as unused.
dsdeming
0

Comments

1 comment

  • Andras B
    dsdeming wrote:
    When I select Find unused variables and parameters, it identifies variables that are contained in strings and used in dynamic SQL statements as unused.

    I'm not sure if I understand you correctly.

    If we have something like :
    declare  @a varchar(10)
    set @a = 'Hi'
    exec ('print''' + @a + ''' ')
    

    then we do find the usages for "@a" properly.

    Could you post an example for your problem. On the other hand parsing the contents of dynamic SQL is outside the scope of our current project and in many cases this problem cannot be solved at all by static analysis.

    Regards,
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.