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
**Time-only source hour-padding quirk**: styles 0/9/100/109 emit single-digit hour WITHOUT leading-space padding (`2:25PM`), but styles 22/130/131 DO pad (` 2:25:36 PM`) — verified against SQL Server 2025. The rationale isn't documented; the simulator mirrors it.
83
83
84
-
**String → date-like** (`SqlValue.CoerceStringToDateLikeWithStyle`): style-aware parser hosts a list of `DateTime.TryParseExact` format strings per style. On parse success, re-encodes through `datetime2(7)` and narrows to the target. On parse failure: if the same input parses under the default style-less parser, raises **Msg 9807** (`"The input character string does not follow style N, …"`); otherwise raises **Msg 241** (`"Conversion failed when converting date and/or time from character string."`). `TRY_CONVERT` swallows both. Currently supports the same 1/10/12/23/101/102/103/110/112/126/127 input forms as the inverse direction; the wider style table from the output direction (styles 2/3/4/5/6/7/11/etc.) doesn't have input-direction parsers and falls through to default parsing — `CONVERT(date, '13.05.2024', 104)` parses via the default ISO parser instead of the German-style format. Minor pre-existing gap; expand on demand.
84
+
**String → date-like** (`SqlValue.CoerceStringToDateLikeWithStyle`): mirrors SQL Server's flexible string-to-datetime parser (probed against SQL Server 2025, 2026-05-27). On success re-encodes through `datetime2(7)` and narrows to the target; on failure, an input that's a valid date by some other format raises **Msg 9807** (`"The input character string does not follow style N, …"`), a non-date raises **Msg 241**. `TRY_CONVERT` swallows both. Two style classes:
85
+
86
+
-**Strict styles** — `12` (`yymmdd`), `112` (`yyyymmdd`), `23` (`yyyy-mm-dd`), `126`/`127` (ISO 8601 with `T`): exact `TryParseExact` format match, no separator flexibility. `CONVERT(date, '05/13/2026', 112)` → Msg 9807.
87
+
-**General styles** (everything else) — route through `DateTime.TryParse` with a family culture. Separators (`/ - .`) are interchangeable; numeric, ISO year-first, and English month-name forms (`Apr 5 2003`, `April 5, 2003`, `5 Apr 2003`) plus optional trailing time / AM-PM / bare time (anchored to 1900-01-01) all parse. The **only** family distinction is date-part order for ambiguous numeric dates: the dmy set (`3`/`4`/`5`/`13`/`14`/`103`/`104`/`105`/`113`/`114`/`130`/`131` → `en-GB`) reads day-first, every other style (→ `en-US`) month-first. A leading 4-digit token is the year, trailing pair in family order — so `2003-04-05` is Apr-5 under style 101 but May-4 under 103 (a 3-format `yyyy{sep}d{sep}M` pre-check supplies the dmy year-first ordering `TryParse` won't). Separatorless `yyyyMMdd` is accepted under every general style.
88
+
89
+
**Known leniency divergences** (simulator accepts more than the live server, low-value edges): the 2-digit-vs-4-digit-year with/without-century restriction isn't enforced (`CONVERT(datetime, '04/05/03', 101)` succeeds; live rejects), and a `T`-separated time is accepted under general styles (live reserves `T` for 126/127, raising out-of-range otherwise).
Copy file name to clipboardExpand all lines: docs/claude/xml.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ Backs `.value()` / `.nodes()` / `.query()` / `.exist()`. Covers the subset SQL S
58
58
### Divergences
59
59
60
60
- Only the path subset above is modeled. FLWOR, arithmetic / comparison / boolean XQuery operators, `local-name()`-style functions in the source text, and constructors are not — they'd surface as malformed XPath or wrong results rather than a clean error.
61
-
-`.value()` casts go through the standard string→type coercion, which inherits the simulator's CONVERT limitations — notably **`CONVERT(datetime, '<yyyy-mm-dd>', 101)` rejects year-first ISO strings the live server accepts under mdy-family styles** (Msg 9807). This blocks the AdventureWorks `vJobCandidateEducation` / `vJobCandidateEmployment` / `vPersonDemographics` views at the downstream `CONVERT`, not at the XML extraction. Tracked as a CONVERT date-style gap, separate from XML.
61
+
-`.value()` casts go through the standard string→type coercion (`casting.md`'s flexible string→date-like parser), so the AdventureWorks `vJobCandidateEducation` / `vJobCandidateEmployment` / `vPersonDemographics` views — which wrap `.value()` date strings in `CONVERT(datetime, …, 101)` — now resolve.
0 commit comments