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. How to connect/disconnect users in sql server.

How to connect/disconnect users in sql server.

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintutorialquestion
2 Posts 2 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.
  • A Offline
    A Offline
    Ashish Kumar Vyas
    wrote on last edited by
    #1

    You have to check whether any users are connected to sql server database and if any user is connected to database, you have to disconnect the user(s) and run a process in a job. How do you do the above in a job?

    A 1 Reply Last reply
    0
    • A Ashish Kumar Vyas

      You have to check whether any users are connected to sql server database and if any user is connected to database, you have to disconnect the user(s) and run a process in a job. How do you do the above in a job?

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      Sounds like a homework question, but..... Take a look at SP_WHO and KILL, but be warned, you need admin (sa) rights to do a kill.

      Ashish Kumar Vyas wrote:

      run a process in a job.

      not sure what you mean here. Run some sql? run a stored proc? what? anyway, hopefully this will point you in the right direction.

      Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

      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