I’m making a query in c# with ADO to select one record from Microsoft SQL Express database. for some test purpose I need to make a delay about 300ms with in SQL Express so that I could simulate my required situation.
There is a limitations that I can not use any store procedures.
Any clue would be appreciated.
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 MyTableEmbedded in a
SqlCommand:Change it to something like this:
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.