Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Dec 12, 2025

Fixes #1671

@edward-burn could you please review this? It was mostly implemented by Claude code, which seems to be pretty good at writing SQL.

@edward-burn
Copy link
Contributor

Have tested on SQL Server 2025 and all worked well!

The only thing I'm wondering is whether it could be clearer that this should all be tied to compatibility level as well as SQL Sever version?

At the moment if you have version 2025 but compatibility level is set to 160 (rather than 170)

Error in `dplyr::collect()`:
! Failed to collect lazy table.
Caused by error in `<fn>`:
! ODBC failed with error 00000 from [Microsoft][ODBC Driver 17
  for SQL Server][SQL Server].
✖ 'REGEXP_LIKE' is not a recognized built-in function name.

Whereas on SQL Server 2022 with compatibility level set to 160

Error in `str_starts()`:
! Only fixed patterns are supported on this backend.
Run `rlang::last_trace()` to see where the error occurred.

@hadley
Copy link
Member Author

hadley commented Dec 15, 2025

Yeah, I'm not too worried about that.

@hadley hadley merged commit 3730c70 into main Dec 15, 2025
15 checks passed
@hadley hadley deleted the sql-server-2025-regexp branch December 15, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support SQL Server 2025 regexp functions?

3 participants