Results 1 to 9 of 9

Thread: Error message

  1. #1
    Join Date
    Mar 2006
    Posts
    127

    Error message

    Hi All,

    One of the jobs that I ran over the weekend failed with the following message:

    Executed as user: user. Database state cannot be changed while other users are using the database 'TestDb' [SQLSTATE 42000] (Error 5070) ALTER DATABASE statement failed. [SQLSTATE 42000] (Error 5069) sp_dboption command failed. [SQLSTATE 01000] (Error 15627). The step failed.

    When I checked the current connections, there were no users connected to the testdb. What could cause this error?

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Anyone was connected during weekend? Did you run 'alter database' statement under master db or TestDb?

  3. #3
    Join Date
    Mar 2006
    Posts
    127
    Nobody was connected to the database. I alter db and sp_dboption statements under master db.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    How do you know there was no connection to the db? Seems sql saw connections at the time.

  5. #5
    Join Date
    Mar 2006
    Posts
    127
    I checked current activity right after the job failed, and I didn't see any connections to that particular db.

  6. #6
    Join Date
    Sep 2002
    Posts
    5,938
    Then ensure you didn't run the job under TestDb. Start job and run 'sp_who2 active' to see if have any connection to that db.

  7. #7
    Join Date
    Mar 2006
    Posts
    127
    Do I run 'sp_who2 active' in master db?

  8. #8
    Join Date
    Sep 2002
    Posts
    5,938
    Yes, that way you know you are not in TestDb.

  9. #9
    Join Date
    Mar 2006
    Posts
    127
    Thanks. I'll try that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •