"Find Unused Variables" misses TABLE variables
danboc
Posts: 23
Hi,
I use the "Find Unused Variables and Parameters" often during scripting. I found that this option doesn't handle TABLE variable at all. Even though the @tableVar is being used in the script (insert, delete, update, select) SQL Refactor will point it out as an unused var.
This has not been fixed in 1.1.3...
Thanks,
Daniel
I use the "Find Unused Variables and Parameters" often during scripting. I found that this option doesn't handle TABLE variable at all. Even though the @tableVar is being used in the script (insert, delete, update, select) SQL Refactor will point it out as an unused var.
This has not been fixed in 1.1.3...
Thanks,
Daniel
Comments
Can you please confirm the exact version you of SQL Refactor you are refering too?
SQL Refactor 1.3 released earlier this week on the 28th July 2008?
Or SQL Refactor 1.1.*?
Can you please reply with a script that you have created that creates this error.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Here's the example code that causes the problem. I've narrowed it down to the delete line. If you comment out the delete line then it does NOT point the @table out, if you leave the delete line in then it points it out as an unused variable.
DECLARE @table TABLE (tabCol1 INT, tabCol2 VARCHAR(50))
DELETE FROM @table
INSERT INTO @table (tabCol1,tabCol2)
SELECT 1,'abc'
Hope this helps!
Daniel
Daniel
I was able to recreate the reported problem, thank you for bringing this issue to our attention.
I have submitted a bug report to highlight the problem for our development team to investigate.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com