Kill all user Process Automatically

  • hi

    Could someone please tell me how I can kill user connection by using SQL agent job or any auto job?

    It because we have backup plan which runs every morning 12am. Some of our developers doesn't like to shutdown the their computer and even SQL Enterprise Manager they just locked the computer and go home. Result is back plan fail to proceed as someone got connection to database but they not using it.

    That was the reason I am looking if I could kill all user process at 11pm every night. Is it possible??

  • How do you perform the backup? If it is SQL Server backup with backup database command, It doesn't matter whether you have users connecting to the database.

    What error message did you receive when your backup plan failed?

  • thanks for your reply.

    i have database maintenance plans which run automatically 12am. Management|Current Activity|Database Maintenance Plans. when it fails it sql sent email to me that backup plan could run last night.

    Is it the right way to do backup plans?

    Could you please recommand more effisient way to do back up plans (i need to do 12am)

  • I guess you choose 'database integrity check' option with 'attempt to fix any minor error' in your maintenance plan, Can you comfirm that?

  • 'database integrity check' not been selected in my backup plans.

  • I think there is a script in the script library that will kill all connections in a database. Just search for kill users, or something like that. If you can't find one, I've got one.

    Tom

  • sorry couldn't find any thing which help kill users. could you pass me one if you have, thank you

  • Enable 'text report' by going plan properties --> reporting tab --> check 'write report to a text file ...', rerun the job --> review the text report to see any useful information.

  • I found the script out there. Search for "Kill all Connections".

    That should do you.

    Thanks Tom

  • i will try this.

    thanks to everyone who reply me.

  • Kill the user's connection is not the solution to resolve the backup failure. We are running 7X24 and get backup done well.

  • I agree, I usually write my own scripts to do backups and dbcc's, and have never run into a problem with backing up the database. I would profile the machine when the job kicks off and see what is actually happening.

    Tom

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply