Chronozoom.Entities.ManualMigrationCheck.ExecFullNativeSQL C# (CSharp) Метод

ExecFullNativeSQL() приватный Метод

Use to run T-SQL scripts for SQL Server or Azure which can't be run through DbCommand since they include native, non-standard commands such as "GO". This runs the scripts through a native interface instead. (Faster than splitting into separate DbCommand calls.)
private ExecFullNativeSQL ( string sqlScript, SqlConnection sqlConnection ) : void
sqlScript string The text of the script to be run.
sqlConnection System.Data.SqlClient.SqlConnection The SQLConnection to run the script against, which should already be established.
Результат void
        private void ExecFullNativeSQL(string sqlScript, SqlConnection sqlConnection)
        {
            try
            {
                ServerConnection serverConnection = new ServerConnection(sqlConnection);
                Server server = new Server(serverConnection);
                server.ConnectionContext.ExecuteNonQuery(sqlScript);
            }
            catch (Exception ex)
            {
                // ensure full text of SQL is included in any error details
                throw new Exception("ExecFullNativeSQL sqlScript:\n\n" + sqlScript, ex);
            }
        }