Problem executing a Stored procedure un SqlServer
-
I have a problem when i try to execute a SP in Sqlserver from ASPX page, the message is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.- .Net SqlClient Data Provider- at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)", then using de back function of the page and try again de operation this is successfull ¿thas any know what happen? Eduardo Sánchez Sigma Tao Project Leader
-
I have a problem when i try to execute a SP in Sqlserver from ASPX page, the message is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.- .Net SqlClient Data Provider- at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)", then using de back function of the page and try again de operation this is successfull ¿thas any know what happen? Eduardo Sánchez Sigma Tao Project Leader
Prueba que no estas bloqueando la BD. O de lo contrario depura tu codigo para ver los parametros del SP que estas ejecutando RAPH
-
I have a problem when i try to execute a SP in Sqlserver from ASPX page, the message is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.- .Net SqlClient Data Provider- at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)", then using de back function of the page and try again de operation this is successfull ¿thas any know what happen? Eduardo Sánchez Sigma Tao Project Leader
-
I have a problem when i try to execute a SP in Sqlserver from ASPX page, the message is "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.- .Net SqlClient Data Provider- at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)", then using de back function of the page and try again de operation this is successfull ¿thas any know what happen? Eduardo Sánchez Sigma Tao Project Leader
If it works the second time you need to use the Prepared property of the Command object. The reason this is taking so long is because it will pre-complie the first time. The second time a query plan has been created. If I were you, I would not be happy with this result. Using Query analyzer you can display the query plan and its percentage costs. This will allow you to understand where your bottleneck is. Maybe you need to take cursors out? Change indexes? Change table layouts? Change view layouts? Also, one thing I have found extremely usefull is assigning the where clause based indexes in your table. The first part of the where should be your primary, then the others should be based an table frequency of that column. Also, when you do a join, sql creates a temp table to hold the join data. Maybe your table is too big? Can you limit that down? I would optimize the procedure if I were in your shoes. PS: By changing the select around you can visually watch the differences. Play with it. Its really fun. At one job, I took a stored procedure down from 2000 lines of cursors to a 100 line select statement. That descreased the spent time by more than 500%. Then using the query plan, adding hints, modifying some table hints and the indexes I speed it up another 200%. It went from more than 8 minutes to 5 - 8 seconds. I was a hero for a short time. You or your employee can do the same. It might take some reading however. Nick 1 line of code equals many bugs. So don't write any!! -- modified at 11:34 Monday 27th March, 2006
-
Prueba que no estas bloqueando la BD. O de lo contrario depura tu codigo para ver los parametros del SP que estas ejecutando RAPH