Home Forums SQL Server 2005 Development Name ,Type Words turns blue color in query window RE: Name ,Type Words turns blue color in query window

  • J (12/23/2008)


    Change the coloring to be all the same color.

    Wut ??

    Highlighting keywords is a valuable assistance provided by the system. A typo in a keyword or failing to add a space between the keyword and a follow-up name will be made immediately obvious. Incomplete strings (missing an apostrophe are also made obvious).

    As for table names or column that are the same as reserved keywords. Well, I also would prefer to be advised about that. Note that over the course of time, a perfectly innocent name may become a reserved keyword, so yes, you can avoid using EXISTING keywords but unless you use a foreign language you can never be 100 % sure this will never happen.

    Try to avoid prefixing columns with "col". This only serves to reduce legibility of the code and, in the specific case of a column holding an identification, labeling the column colID instead of ID does not help you - colid is also a keyword recognized by the system.

    The color is there to tell you something. Turning it off it akin to burying your head in the sand to avoid seeing what you do not want to see. And are you going to force everybody else in your outfit to neutralize the coloring so that a minor issue such as a column or table name shown off as a reserved keyword remains hidden ?

    It was only a suggestion for the OP if they are bothered by the coloring.

    As for me, I just ignore the erroneous "reserved word" (sic) colorization. E.g., since when is "colid" a reserved word? (BTW, "colid" is not highlighted as a keyword on my system).

    I suspect that the "keyword" list includes every column in every one of the system tables. Which would be totally wrong.

    As for "correctness" of the reserved words, the following works fine in SQL Server 2005:

    CREATE TABLE NAME (STATUS INT, UID UNIQUEIDENTIFIER);


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]