Friday, August 09, 2013

Make linqpad show sql print statement in the console by doing this

Throw this baby on the top of your linqpad code and enjoy print goodness.

((System.Data.SqlClient.SqlConnection)this.Connection).InfoMessage += (object obj, SqlInfoMessageEventArgs e)=>{
    if (e.Message.Length < 200)  string.Format("    TSQL PRINT: {0}", e.Message).Dump();

};

No comments: