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