Formats SQL server queries with a DECLARE up top for parameter values
Inheritance: ISqlFormatter
        public string FormatSql(SqlTiming timing)
        {
            var sqlFormatter = new SqlServerFormatter();
            var sqlFormat = sqlFormatter.FormatSql(timing);

            var poorMansFormatter = new TSqlStandardFormatter();
            var fullFormatter = new SqlFormattingManager(poorMansFormatter);
            return fullFormatter.Format(sqlFormat);
        }
Example #2
0
 private void LogCommandAsError(Exception exception, ExecuteType type)
 {
     var formatter = new SqlServerFormatter();
     SqlTiming timing = new SqlTiming(this, type, null);
     exception.Data["SQL"] = formatter.FormatSql(timing);
 }