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. Database & SysAdmin
  3. Database
  4. SQL Stored Procedure Question???

SQL Stored Procedure Question???

Scheduled Pinned Locked Moved Database
databasequestion
3 Posts 3 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.
  • T Offline
    T Offline
    Toniyo Jackson
    wrote on last edited by
    #1

    What will happen if 1000 users trying to execute the stored procedure at a time? How it will work? Single thread or multi thread or FIFO manner?

    A person might be able to play without being creative, but he sure can't be creative without playing.

    D D 2 Replies Last reply
    0
    • T Toniyo Jackson

      What will happen if 1000 users trying to execute the stored procedure at a time? How it will work? Single thread or multi thread or FIFO manner?

      A person might be able to play without being creative, but he sure can't be creative without playing.

      D Offline
      D Offline
      dasblinkenlight
      wrote on last edited by
      #2

      When multiple users try executing the same stored procedure, multiple instances will start running asynchronously. What happens next depends on the body of the stored procedure: if different instances of the stored procedure only read the data, or if they update distinct rows, all instances would run asynchronously to completion. Otherwise, some of them would block, following the usual rules of locking for your transaction isolation level. As a consequence, you can also force synchronization in the body of a stored procedure by selecting for update (or selecting with rowlock, etc.)

      1 Reply Last reply
      0
      • T Toniyo Jackson

        What will happen if 1000 users trying to execute the stored procedure at a time? How it will work? Single thread or multi thread or FIFO manner?

        A person might be able to play without being creative, but he sure can't be creative without playing.

        D Offline
        D Offline
        David Skelly
        wrote on last edited by
        #3

        When a task request is received, SQL Server will attempt to allocate the task to an available worker thread. If no worker thread is available, a new one will be created to handle the task, up to the configured maximum number of threads. Once that maximum limit has been reached, task requests will queue until a thread becomes available. As you might guess, it's quite a lot more sophisticated than that, but that is essentially what it boils down to. If you want to know more detail, there are plenty of articles on Google that will explain it in as much detail as you want.

        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