This repository contains a minimal Windows desktop application for executing parameterized SQL scripts with sqlcmd.
The application allows you to:
- Browse for a
.sqlfile. - Automatically detect SQLCMD variables in the script that are not defined by
:setvarcommands, and prompt for their values. - Enter SQL Server connection information.
- Execute the script via the
sqlcmdcommand-line tool and display the output.
The source is implemented as a WPF project targeting .NET 6.0.
Use the .NET SDK on Windows:
dotnet build SqlcmdGuiApp/SqlcmdGuiApp.csprojAfter building, run the produced executable or start it with dotnet run:
dotnet run --project SqlcmdGuiApp/SqlcmdGuiApp.csprojYou need the sqlcmd utility available in your PATH for the execution step to work.
The application invokes sqlcmd with the -b option so that any errors result
in a non-zero exit code.
Any unhandled errors encountered by the application are written to error.log in the application directory.