Options

Doesn't capitalize keyword CASE

MikeyCMikeyC Posts: 249 Bronze 3
edited November 11, 2009 5:37AM in SQL Prompt Previous Versions
With this code:
SELECT 
	* 
FROM msdb.dbo.backupfile
WHERE
	case<cursor>

When I type a space SQL Prompt does not convert it to upper case. I think the problem is that there is a table named Case in the DB, and it is suggesting that I use that even though it isn't a valid suggestion at that point in the query.

Why does SQL Prompt suggest all of the table in a database in the beginning of the WHERE clause? (Or for that matter in the SELECT portion of the clause when the table isn't included in the FROM or is aliased in the FROM clause?)

Comments

  • Options
    Anu DAnu D Posts: 876 Silver 3
    Many thanks for your post.

    When you type the letters Ca<cursor> (to type word case) SQL Prompt should suggest you both the options for table 'Case' and keyword 'CASE' you can select accordingly.

    Kindly let me know if SQL Prompt doesn't suggest both the option for you.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Options
    MikeyCMikeyC Posts: 249 Bronze 3
    It does, however the suggestion isn't the problem, it is the lack of it capitalizing the reserved word when it is supposed to.

    Try this:
    SELECT *
    FROM msdb.dbo.backupfile
    WHERE
    	CASE 
    	
    CREATE TABLE dbo.&#91;Case&#93;
    &#40;
    	Test varchar&#40;10&#41; null
    &#41;;
    
    --Refresh Suggestions
    
    SELECT *
    FROM msdb.dbo.backupfile
    WHERE
    	case&lt;cursor&gt; 
    	
    DROP TABLE dbo.&#91;Case&#93;;
    

    If you try it before you create the [Case] table and refresh the suggestions CASE is properly capitalized after you type it and a space, once you create the [Case] table it is not.
  • Options
    Anu DAnu D Posts: 876 Silver 3
    Many thanks for your post.

    I have logged this issue in our internal tracking system whose unique Id is SP-2863.

    Kindly let us know if you have any other issues or questions regarding the product,I'll like to help.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
Sign In or Register to comment.