What are the challenges you face when working across database platforms? Take the survey

SQL Prompt STILL doesn't respect SQL XML DML statements

mscheunermscheuner Posts: 57
edited September 26, 2008 10:10AM in SQL Prompt Previous Versions

Even now, in SQL Prompt 3.9, I am *STILL* getting into trouble since SQL Prompt attempts to UPPERCASE some keywords in my SQL XML DML statements which have to be lowercase by definition.

E.g. if I start typing:


in order to try and declare an XML namespace in the XQuery, even though it's CLEARLY inside a string, SQL Prompt 3.9 insists on UPPERCASING that identifier:

e.EntryData.value('DECLARE namespace x="http://schemas.garaio.com/xxx/xxx";(x:DataEntry_IPCPro/x:MinContractDuration)[1]', 'int')
dbo.T_Contract c

and when I try to execute that SQL statement, I get an error:

Msg 2209, Level 16, State 1, Line 5
XQuery [dbo.T_Entry.EntryData.value()]: Syntax error near 'DECLARE'

The same happens with a few more keywords (e.g. "count" and others).

Is there a way to make SQL Prompt 4 a bit smarter so that it WON'T keep UPPERCASING stuff when I'm typing something inside a string delimited by quotes ' .... ' ? Or could it be even smarter and discover I'm typing a SQL XML DML statement and just leave me alone in that case???



  • Options

    SQL Prompt is converting your keywords to upper-case. If that's causing a problem, than you can disable this in the prompt options. On the Inserted Candidates tab, click Case, then change reserved keywords to leave as is.

    I can add a suggestion to leave keywords alone if they appear inside a quoted string, but I can't guarantee this will appear in Prompt unless a lot of people ask for it.
  • Options
    Hi Brian,

    I understand what SQL Prompt is doing, and I would like it to UPPERCASE my keywords - but it should be smarter about the CONTEXT they're in when deciding whether to update or not.

    E.g. if I'm typing a keyword after a "." following a XML data field, e.g. after
    "EntryData." - then it should *NOT* under any circumstances UPPERCASE my "modify" - it's a XML DML keyword which HAS to be lowercase.

    Also, if I'm insde a string delimited by quotes ' ..... ', SQL Prompt should NEVER EVER attempt to UPPERCASE stuff on me..... it's my string - leave me alone!

    But I don't want to have to be forced to turn off uppercasing overall - I like that. Just make SQL Prompt smarter about the CONTEXT of a keyword before attempting to uppercase it........

Sign In or Register to comment.