Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have tried to make async calls to my SQL Server instance as you may see on my SO post:

ASP.NET MVC 4 asyncronous database call: never returns the HTTP response

I did a benchmarking and the sync version is better than async one when there is even lots of concurrent loads. I am not sure if I got this right and opened the connection as async to my SQL Server instance.

The query does not take too much time and considering the fact that asynchronous code has much more overhead than the sync one, this might be the issue here as well. On the other hand, honest to say, I am not sure how to check if I opened the connection successfully as async or not.

Is there any chance I could check if the query is successfully completed as asynchronously?

share|improve this question
add comment

3 Answers

As far as I can tell, SQL Server doesn't know a query is asynchronous. It's always synchronous to SQL Server. The connection string change appears to affect the client only.

sys.dm_exec_connections etc don't have anything to show whether a query is asynchronous or not

share|improve this answer
    
thanks! Do you have any idea about what my problem would be here? Do you think that the query time is short and async call is pointless in this case? –  tugberk Apr 3 '12 at 8:49
    
In this case, my gut feeling is "KISS". Do you need asnyc processing? If not, don't add complexity –  gbn Apr 3 '12 at 8:52
    
Actually, the sample I have referred is just a try-out. I have some complex and long running queries which can benefit from running async with .NET client. –  tugberk Apr 3 '12 at 8:54
add comment

SQL Server only supports synchronous calls. If you are doing async via .NET as far as the database knows they are sync. Any performance problems would be from the .NET side.

share|improve this answer
add comment

I would use the Profiler to monitor connections and determine if a query completed - it can give you a complete information about what connects and what runs.

However, could you solve your problem using a more mainstream approach, such as starting a new thread, opening a normal SqlConnection in it, and executing a SqlCommand?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.