Suggestions missing for longer T-SQL code
I have some longer Stored Procs and other T-SQL code and it appears that after some number of lines between the declaration of a variable, table, etc., and its subsequent usage, SQL Prompt no longer suggests the object.
I would have sworn there was an option that I could configure to say how many lines of code to look-back for declared objects.
Can we get that back?
This is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Stephen commented
I left a LONG post on the issue of missing suggestions that included my having set the look-back config to 100,000 BYTES (Yes, bytes, not lines, and 8/16 encoding matters, too). Issues occur with an SP of just 250 LINES, 8K characters. (See: http://www.red-gate.com/MessageBoard/viewtopic.php?t=15019)
Appears there's a bug of long duration (I've had this issue since v2) that I hope RG can finally kill off as it's very frustrating with SMALL SPs, let alone my monster @ 2600 LINES (175,773 CHAR), to have SQL Prompt "resign" its task.
Several existing UPDATEs I edited in a 700-line SP today, April 16th 2012, failed to attract SQL Prompt 5.3.0.3's interest in giving me a clue! And that was WITH the ParserLookBackDistance set to 100,000 BYTES and being at line 460 - hardly consuming 2K characters per line above it...
Sure wish I could give this more than my paltry 3 votes, just to get some RG interest in fixing this aggravating, persistent, unpredictable BUG!
-
Stephen commented
Johan's suggestion looks like a very good one... I've had this issue since the very first SQL Prompt and have been through the whole network latency with large scripts issue that was addressed a few major releases ago, but the "I forget there's a variable or parameter @Something" needs to be addressed better than the 30000 line-scan override.
Please consider Johan's suggestion. Gets my 3 votes for sure.
-
Johan Buret commented
I also work with larger scripts. Although Paul Stephenson's suggestion works it provokes a too big performance hit even on a good computer.
SQL Prompt parsing should provide a shortcut to fully parse a script and extract objects definitions, even if kept on a somewhat static cache, and keep the dynamic part for the section of the script the user edits.
-
Jim commented
Hi Paul,
Thanks for the information, I will try it out.
Jim
-
AdminPaul Stephenson (Admin, Redgate) commented
Hi Jim,
There is an option but you have to edit an XML file to get to it. See http://www.red-gate.com/MessageBoard/viewtopic.php?t=12552, where I said this:
1. Open up "%LOCALAPPDATA%\Red Gate\SQL Prompt 5\RedGate_SqlPrompt_Engine_EngineOptions.xml" in a text editor.
2. Find the tag <ParserLookBackDistance>.
3. Increase the number in the tag from 5000 to something bigger like 30000.Please be aware that very large values of this option have not been thoroughly tested and may cause performance degradation, so use with caution.