I am creating an automated queue for executing database queries, which essentially means that I create a queue of SQL queries that are executed one after the other.
Requests are executed using code similar to the following:
using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString)) { cn.Open(); using (SqlCommand cmd = new SqlCommand("SP", cn)) { cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { } } } }
What I would like to do is collect as much information as possible about the implementation. How much time has passed. How many lines were affected.
Most importantly, if it DOESNβT, why it failed.
In fact, any information I can get about the execution that I want to keep.
c # statistics sqlcommand sql-server-2005 sqldatareader
Theofanis pantelides
source share