SQLCMD mode SQL script execution library. Allows your .Net application to run .sql files against SQL Server. Handles the batch delimiters (GO) and SQLCMD mode commands like :setvar
or :connect
.
using com.rusanu.DBUtil;
SqlCmd.ExecuteFile(SqlConnection, @"The\Path\To\Your\Sp.sql");
using com.rusanu.DBUtil;
var inst = new SqlCmd(SqlConnection)
inst.ExecuteFile(@"The\Path\To\Your\Sp.sql");
Available on NuGet.org as com.rusanu.DBUtil