Link to home
Start Free TrialLog in
Avatar of shekhar_shashi
shekhar_shashi

asked on

SQL Query cost calculation before firing the query

I am working on a Windows Forms based .Net application that uses SQL 2008 database as back-end. We have a few search screens that allow the user to enter search criteria. Some queries take a lot of time to execute while most of the queries take only a few seconds. Is there a way to prevent a query from being fired if the cost of the query is expected or calculated to be very high?I'd like to display a warning message to the user that the query would potentially run for a while. The user should given the choice of refining the query or agree to wait several seconds.

We are using select top 100 is the queries but is there a different solution that would warn the user before firing the query?





ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial