| Author |
Message |
JMorganSmith
Joined: 03 Apr 2009 Posts: 1
|
Posted: Fri Apr 03, 2009 12:21 am Post subject: False Positive for Find Unused Variables and Parameters |
|
|
I have seen several examples in these forums of people posting where they received false positives for unused variables, but most of them were using versions previous to v1.3.x
However, I did find one posting regarding table variables where the person was using the latest version.
I have version 1.3.0.207 and the following code (@LastID) is flagged as an unused variable:
| Code: |
DECLARE @LastID INT
SET @LastID = @LastID + @@ROWCOUNT
DBCC CHECKIDENT( 'TABLE_NAME_here', RESEED, @LastID) |
Thanks _________________ J. Morgan Smith
Senior BI Architect
Teksouth Corporation |
|
| Back to top |
|
 |
eddie davis
Joined: 14 Jun 2006 Posts: 796 Location: Red Gate Software
|
Posted: Mon Apr 06, 2009 5:34 pm Post subject: |
|
|
Thank you for your post into the forum.
Using the code sample, I can recreate the reported fault symptoms.
However when I execute your sample code I get the following error:
Msg 2560, Level 16, State 9, Line 3
Parameter 3 is incorrect for this DBCC statement.
This indicates that the DBCC CHECKIDENT command is valid but does not like the way you have called the third parameter.
I suspect this is the reason why SQL Refactor thinks that your parameter @LastID is unused.
Many Thanks
Eddie _________________ Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group