Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem executing a Stored procedure un SqlServer

Problem executing a Stored procedure un SqlServer

Scheduled Pinned Locked Moved ASP.NET
csharpsharepointdatabasesysadminhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    essuarez
    wrote on last edited by
    #1

    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

    R E I 3 Replies Last reply
    0
    • E essuarez

      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

      R Offline
      R Offline
      Ralph Chuque Guerra
      wrote on last edited by
      #2

      Prueba que no estas bloqueando la BD. O de lo contrario depura tu codigo para ver los parametros del SP que estas ejecutando RAPH

      E 1 Reply Last reply
      0
      • E essuarez

        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

        E Offline
        E Offline
        E L Golpe
        wrote on last edited by
        #3

        Try setting your SqlCommand.CommandTimeout parameter to something higher, like (1000) and see if that helps. The default timeout for commands is 30 seconds, and probably your reader hasn;t finished the reading. Practice sesquipedalianism! ;)

        1 Reply Last reply
        0
        • E essuarez

          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 Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • R Ralph Chuque Guerra

            Prueba que no estas bloqueando la BD. O de lo contrario depura tu codigo para ver los parametros del SP que estas ejecutando RAPH

            E Offline
            E Offline
            essuarez
            wrote on last edited by
            #5

            Gracias, Efectivamente incurri en un bloqueo a una tabla en mi base de datos:sigh: Eduardo Sánchez Sigma Tao Project Leader

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups