Enhancement Request

tdewitttdewitt Posts: 7
edited February 5, 2008 1:21AM in SQL Prompt Previous Versions
When entering comments, Sql Prompt will automatically capitalize SQL Keywords that are typed into the comment. Such as this phrase: "date from product order" becomes "date FROM product ORDER". It would be nice if SQl Prompt recognized that you were entering text in a comment line/block and not perform the capitalization.

Comments

  • Thanks for your post.

    Would you be able to show me some example syntax that recreates this problem. I don't experience the same symptoms when I tested it here, so there must be something else confusing the parser.

    Also, could you let me know which version of SQL Prompt you are using. I tested this in SQL Prompt 3.6.
    Chris
  • 'i think this IS_MEMBER( a good ) example. IF OR the TIME '

    not a comment but text between '' should not be messed with.
  • Thanks for the reply.

    Is it possible that there is some invalid SQL above the string that is confusing the parser? Simply having the string as the query is invalid SQL and would stop the parser functioning correctly, but you may be experiencing the same symptoms in real world examples.

    For example, an unclosed comment block could cause this, or something like an un-commented-out <more code here> reminder in the script could break the parser.

    If you have experienced this issue with a valid script, then could you please send me an example (here or by pm) and I will continue to investigate.

    Thanks,
    Chris
  • Isn't this a version thing , I remeber in V2 it happened and I thought it was fixed in V 3

    I am running V 3.6 and I can't get it fail , in either /* */ or -- comments

    Cheers
    Mike
  • I found a way to reproduce this problem in Sql Analyzer 2000 with 3.6.

    paste in the following:
    IF &#40;SELECT DATEDIFF&#40;s, @StartTime, @GetDate&#40;&#41;&#41;&#41; &gt; @TimeOutSec
    		begin
    			RAISERROR &#40;'A  ', 16, 1&#41; 
    	
    	return
    

    Start typing into the string part of the error. For example, try to make it 'A timeout has occured!'. Timeout is a keyword and will get capitalized.

    If you either add 'END' after the Raiseerror or comment out the RETURN statement it will let you type freely.
  • Ah Ah

    I have a snippet set up that always adds my end when I add begin

    I use be to add a BEGIN - newline- END pair

    So I wouldn't see a problem like this

    Mike
  • MikeONeill wrote:
    Ah Ah

    I have a snippet set up that always adds my end when I add begin

    I use be to add a BEGIN - newline- END pair

    So I wouldn't see a problem like this

    Mike

    This is just one way to reproduce the problem. Not having a RETURN in a proc can sometimes cause it. It should never auto-complete text inside a comment.
  • Thanks for the continuing reports.

    The only answer to this set of issues is that with the current release of SQL Prompt, any invalid or illegal SQL will break the parser. This will have undesired effects when writing comments, strings etc.

    This was originally thought of as something that was not going to fixed as it was viewed that not much can be done about parsing invalid SQL.

    However, this seems to be quite an issue for quite a lot of users so the development team are going to take steps to address this issue in a future version. It is curently under review, and for your reference the bug tracking number is SP-793.

    If you would like to run through your script to see the code that SQL Prompt has a problem with, SQL Refactor should be able to help.
    Chris
Sign In or Register to comment.