0

I'm using Prepared Statement in Visual Studio 2012 c#.

I use using(SqlTransaction transaction = conn.BeginTransaction()) and preparedStmt.ExecuteNonQuery().

Is it possible, after executing ExecuteNonQuery() or preferably before it, retrieve the resulting SQL that it generates?

I know that prepared statements are ran directly on the DBMS and aren't a SQL string built on the application server. But I need to debug some SQL statements directly on DB as plain SQL.

When ExecuteNonQuery() brings an Exception, it has only the error message, not the SQL that was executed, and I'm having trouble to debug without the proper SQL.

Hikari
  • 3,797
  • 12
  • 47
  • 77

0 Answers0