Mssqllocaldb (2025)

Lena flinched. “SQLite isn’t a relational database. It’s a clever file with SQL pretensions. We use ROW_NUMBER() , CTEs, and MERGE statements. SQLite will choke. We need the real engine.”

Lena presented the results. She showed a graph: “Full SQL Server on build agent” – 11 minutes. “SQLite with faked queries” – 4 minutes, but 27 flaky tests. “mssqllocaldb” – 58 seconds, 100% pass rate.

The Ghost in the Pipeline

“It’s SQL Server Express,” Lena said. “Same parser, same optimizer, same transaction semantics. It just runs in my process. No Windows service. No admin rights. No installers. Microsoft shipped it with Visual Studio 2012 and it’s been there ever since, hiding in plain sight.”

# In the pipeline's "Initialize" step & "C:\Program Files\Microsoft SQL Server\130\Tools\Binn\SqlLocalDB.exe" create "CodeCraftBuild" -s & "SqlLocalDB.exe" info "CodeCraftBuild" The output was magical: Name: CodeCraftBuild Version: 13.0.4001.0 Shared name: Owner: DESKTOP-BUILD-42\jenkins Auto-create: Yes State: Running Last start time: 10:34:22 AM Instance pipe name: np:\.\pipe\LOCALDB#F365A2E6\tsql\query mssqllocaldb

She ran the pipeline. Green. Beautiful, unbroken green. The build agent’s disk footprint? 400 MB for the LocalDB binaries. No services left running. No leftovers. Just a clean, ephemeral, perfect database that lived and died inside the test run.

Lena stared at the Azure DevOps pipeline logs, a waterfall of red text cascading down her screen. The error was always the same: “SqlException: Cannot open database "WidgetMetrics_Test" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\SYSTEM'.” Lena flinched

The new hire’s jaw dropped.