This code will cause SQL Prompt to flag @totalRecords as 'Variable declared but never used.'
Comments
1 comment
-
Hi @Ozzie,
I have used your script and @totalRecords INT is reported as 'Variable declared but never used.'
I think that is correct, as you are initializing @totalRecords=COUNT(*) but never actually use this variable.
If you add, for example:SELECT * FROM [#AssessmentDetails] AS [ad] WHERE [ad].[planID] > @totalRecords
at the end of your script, the issue will disappear.
Regards,
Fabiola
Add comment
Please sign in to leave a comment.