SpDev — SQL Procedure Development
Debug SQL Server stored procedures like regular code. Edit locally, trace variables, step through execution.
Two Ways to Debug
Mode 1: Standalone (No .NET Project Required)
Just have a .sql file and a SQL Server connection. The extension handles everything:
- Open any
.sql file in VS Code
- Right-click the file → "Debug Standalone" (or run command:
SpDev: Debug Standalone)
- Enter your SQL Server connection string (saved for next time)
- Enter values for each
@parameter found in the SQL
- Debug starts — line highlighting, variables panel, step over/continue
No .NET project, no NuGet package, no configuration needed.
Mode 2: Integrated (With .NET Project)
For debugging stored procedures called from your .NET application:
Install the NuGet package:
dotnet add package SpDev.Runtime
Configure in Program.cs:
builder.Services.AddSpDev(options =>
{
options.Enabled = builder.Environment.IsDevelopment();
options.ProcedureDirectory = "./Procedures";
});
Create a Procedures folder with your .sql files
When your app calls EXEC MyProc or uses Dapper with CommandType.StoredProcedure,
the local .sql file executes instead with full tracing
Features
- Standalone Debug: Debug any
.sql file without a .NET project — just provide a connection string
- Local File Execution: Edit stored procedures as
.sql files in your project
- Dapper Support: Works with EF Core, Dapper, and raw ADO.NET
- Variable Tracing: See variable values at each statement
- Step-Through Debugging: F10 to step, F5 to continue
- Zero Production Impact: Disabled by default, no overhead when off
- Sync Status: See which procedures have drifted from database
Requirements
- .NET 8 SDK (for standalone mode)
- SQL Server 2019+ or Azure SQL Database
- For integrated mode: SpDev.Runtime NuGet package
Extension Settings
This extension contributes the following settings:
spdev.connections: Array of saved connection strings for quick access
spdev.traceServerPort: Port for trace server (default: 52341)
Known Issues
See GitHub Issues
Release Notes
0.1.2
- Standalone debug mode: Debug any
.sql file without a .NET project
- Dapper support:
CommandType.StoredProcedure now intercepted
- Connection string saving for quick reuse
- Parameter auto-detection from SQL files
0.1.0
Initial release with:
- EXEC statement interception
- Variable tracing
- Step-through debugging
- Sync status tree view
| |