You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [4]: sql = """
...: SELECT
...: TOP 10
...: s.RECORDID, /* , rd.FormContent */
...: n.c.value('(/*:FORM_ROOT/*:SOME_TAG)[1]', 'float') AS SOME_TAG_VALUE
...: FROM source_table.dbo.source_data AS s(nolock)
...: CROSS APPLY FormContent.nodes('/*:FORM_ROOT') AS N(C)
...: """
In [5]: import sqlglot.expressions as sge, sqlglot as sg
In [6]: print(sg.parse_one(sql, read="tsql").sql('tsql', pretty=True))
SELECT
TOP 10
s.RECORDID, /* , rd.FormContent */
n.c.VALUE('(/*:FORM_ROOT/*:SOME_TAG)[1]', 'float') AS SOME_TAG_VALUE
FROM source_table.dbo.source_data AS s(nolock) CROSS APPLY FormContent.NODES('/*:FORM_ROOT') AS N(C)
VALUE and NODES are methods on their respective objects and it is incorrect to alter their case like this.
VALUE
andNODES
are methods on their respective objects and it is incorrect to alter their case like this.docs: https://learn.microsoft.com/en-us/sql/t-sql/xml/xml-data-type-methods?view=sql-server-ver16
The text was updated successfully, but these errors were encountered: