SQL Server 2025 LocalDB Crash – REGEXP Functions Break Due to Missing RegExpr.dll
SQL Server 2025 LocalDB Crash – REGEXP Functions Break Due to Missing RegExpr.dll ⚠️
SQL Server 2025 bug – LocalDB crash caused by missing RegExpr.dll when using REGEXP functions
Hi SQL Server Guys,
In my previous article we talked about SQL Server LocalDB and how it works internally.
If you missed it, you can read it here:
Good to Know: What Is SQL Server LocalDB?
LocalDB is a lightweight version of SQL Server designed mainly for developers. It runs in user-mode, starts automatically when needed and does not require a Windows service.
We also recently talked about the very powerful REGEX expressions introduced in SQL Server 2025 here: SQL Server 2025 Regex Support
These functions make text processing inside SQL Server much easier.
But here comes an interesting problem.
A bug in SQL Server 2025 LocalDB can cause the database engine to crash when using the new REGEXP functions.
New REGEX Functions in SQL Server 2025
SQL Server 2025 introduces native regular expression support with functions such as:
- REGEXP_LIKE
- REGEXP_REPLACE
- REGEXP_SUBSTR
These functions allow SQL Server to perform pattern matching and text transformations directly inside T-SQL.
For example:
SELECT REGEXP_REPLACE('the cat sat on the mat','cat','dog');
Expected result:
the dog sat on the mat
However, when running this query in SQL Server LocalDB, something unexpected can happen.
The SQL Server process may crash completely.
Typical Error Message
When the crash occurs, developers usually see errors like these:
Named Pipes Provider: The pipe has been ended
Communication link failure
Msg 10054
A transport-level error has occurred
At this point the connection drops because sqlservr.exe has crashed.
Minimal Test That Can Crash LocalDB
Here is a very small script that can reproduce the issue.
PRINT 'Testing SQL Server 2025 REGEX engine';
SELECT @@VERSION;
PRINT 'Running REGEXP test';
SELECT REGEXP_REPLACE('SQL Server LocalDB test','test','BUG');
If the bug is present:
- the query does not return a result
- the connection suddenly drops
- the LocalDB instance stops
Another minimal example:
SELECT REGEXP_LIKE('abcdef','abc.*');
How to Verify LocalDB Has Crashed
You can verify the LocalDB instance status using the command line:
sqllocaldb info MSSQLLocalDB
Or try restarting it:
sqllocaldb start MSSQLLocalDB
If the engine crashed, this command will start it again.
The Real Cause
Interestingly, the issue is not caused by the SQL Server engine itself.
The real problem appears in the LocalDB installation package.
When analyzing the logs, an error like this can appear:
EXCEPTION_MOD_NOT_FOUND
Delay load failure occurred for module 'RegExpr.dll'
This indicates that SQL Server is trying to load a library that does not exist in the LocalDB installation.
The missing DLL files are:
- RegExpr.dll
- vectorffi.dll
These libraries are required for new SQL Server 2025 features such as:
- the new REGEXP engine
- the new VECTOR data type
If the DLL cannot be loaded, sqlservr.exe generates a stack dump and terminates.
Why This Happens Only in LocalDB
Interestingly, the problem does not occur in other SQL Server editions.
- SQL Server Developer
- SQL Server Express
- SQL Server Standard
- SQL Server Enterprise
All of these installations include the required libraries.
The issue appears to exist only in the SQLLOCALDB.msi package, which currently ships without those DLL files.
Temporary Workaround
Some developers managed to temporarily fix the issue by manually copying the missing DLL files.
From:
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn
To:
C:\Program Files\Microsoft SQL Server\170\LocalDB\Binn
However, Microsoft does not recommend this approach.
Official Workaround
Until Microsoft releases a fix (likely in a future CU), the safest solution is to use:
- SQL Server Express
- SQL Server Developer Edition
Both include the required libraries and do not suffer from this issue.
Final Thoughts
This is an interesting example of how a missing dependency in an installer can cause unexpected crashes in SQL Server.
The database engine itself works correctly, but the LocalDB package currently lacks the required libraries for the REGEX engine.
Until a fix is released, developers working with SQL Server 2025 should avoid using REGEXP functions inside LocalDB.
And remember…
Sometimes one missing DLL is enough to take down an entire SQL Server instance 😉
See you in the next SQL Server deep dive!
Luca Biondi @2026

Comments
Post a Comment