You could possibly inject a WAITFOR into your SQL:
See this SO QA for more info Sleep Command in T-SQL?
Given a command sent to the database:
SELECT * FROM MyTable
Embedded in a SqlCommand
:
using (var conn = new SqlConnection("connection string"))
using (var comm = new SqlCommand("", conn))
{
conn.Open();
comm.CommandText = "SELECT * FROM MyTable";
comm.ExecuteNonQuery();
}
Change it to something like this:
using (var conn = new SqlConnection("connection string"))
using (var comm = new SqlCommand("", conn))
{
conn.Open();
#if DEBUG
comm.CommandText = "WAITFOR DELAY '00:00:01.000'; SELECT * FROM MyTable";
#else
comm.CommandText = "SELECT * FROM MyTable";
#endif
comm.ExecuteNonQuery();
}
To embed a 1 second wait.
Ideally you don't want to do this in such an ugly and questionable way, but for the purposes of demonstration it will suffice.