Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually i am getting user records from database through stored procedure. i am getting that records in dataset and binding to gridview. here problem is time out exception. runnin the stored procedure is taking much time. i taken that stored procedure as a separate query and executed it is taking 32 seconds to execute the query...is there any solution to over come this..
Posted
Comments
Parviz Bazgosha 25-Jul-13 6:11am    
how many you have records ...?

check your select .

remember join multi tables is faster than (in line select ) in most case

how many your proc returns records ?

ARE CHECK TOP(n) in Select ?
ntitish 26-Jul-13 5:18am    
Actually sir my stored proc for getting the users from 50 Kilometers radius using Zip code.below i am pasting my code

SELECT * from Users.Userid=B.Userid
WHERE Users.UStatus='A'

and Groups.GroupID In
(
select GroupID from Groups A,
(
SELECT Zip FROM (
select Convert(varchar(max),Zip) Zip,
( 3959 * acos( cos( radians(@lat) ) *
cos( radians( Lat ) ) *
cos( radians( Long ) -
radians(@long) ) +
sin( radians(@lat) ) *
sin( radians( Lat ) ) )) as distance from cities
) A WHERE distance < 50
) B
where A.Zip=B.Zip
)
Adarsh chauhan 25-Jul-13 6:15am    
Please share your code and stored proc. so that we can find out where the problem actually is.
without enough information it would be just hit and trial for us.
there may be n no. of reasons for SP running slow..
ntitish 26-Jul-13 5:20am    
Sir i pasted my code in above comment can u say any thing by seeing that
[no name] 25-Jul-13 6:15am    
Sure there is. Profile your query and then fix your bottlenecks.

1 solution

 
Share this answer
 
Comments
Adarsh chauhan 25-Jul-13 6:40am    
Very useful and informative links...
I read most of links posted by you people just to find something new and I am happy that every time I access a link i learn something new... :)
Thanks to you people and codeproject.com .. :)
+5
Maciej Los 25-Jul-13 6:44am    
You're welcome and Thank you ;)
Raja Sekhar S 26-Jul-13 6:11am    
As usual... Nice Links Maciej Los.... +5!
Maciej Los 26-Jul-13 7:45am    
Thank you, Raja ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900