Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:58:54+00:00 2026-06-04T19:58:54+00:00

We have an automated script to restore a Sybase database and then run our

  • 0

We have an automated script to restore a Sybase database and then run our automated tests against it. Quite often we have a web server or interactive query tool connected to this database. These connections prevent the Sybase load with “…must have exclusive use of database to run load”.

How do I kick/kill/terminate all connections?

I’d like something similar to Sql Server’s alter database single_user with rollback immediate. This is a local Sybase instance so we have full admin rights.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:58:56+00:00Added an answer on June 4, 2026 at 7:58 pm

    Without knowing exactly what condition the script checks for, there are two things you need to do to guarantee exclusive use of a database (i) run “master..sp_dboption ‘your-db-name’, ‘single user’, false” to put it in single-user mode, and (ii) kill all existing users first with the “kill” command.

    This is not difficult to put in a stored procedure — kill all connections using your database as their current database or having a lock in that database, and then try to set it to single-user mode. Then check if the single-user mode succeeded — you should allow for a repeated try since it is possible that a new user has connected again just when you’re setting it to single-user mode.

    This is all not difficult to implement, but you will need some understanding of the ASE system tables. But primarily, I think you need to figure out exactly what it is your load script assumes to be the case and what it checks for.

    There may be other solutions as well: if you can just lock the tables affected by your load script for example, that may also be a solution (and a simpler one). But this may or may not be possible, depending on what the load script exactly does and what is expects. So that would be question #1 to answer.

    HTH,

    Rob V.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: We have web based product and a growing suite of automated Selenium tests
In our current database development evironment we have automated build procceses check all the
For automated testing (using Hudson) I have a script that generates a bunch of
I am building a Backbone app and I need to have automated tests. I
I have inherited a reasonable sized ASP.net solution that has no automated tests. The
I have been using Selenium Library with Robot Framework for writing automated tests for
I have an automated script that generates a graph every day using GNUPlot. The
I've got an automated script that parses a server and clones all the repos
I have an automated script - I mean, it runs every 10 minutes by
I am trying to have an automated script that enters into the most recently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.