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 162047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:19:18+00:00 2026-05-11T11:19:18+00:00

We have 2 databases, say DB1 and DB2. DB1 contains all the stored procedures

  • 0

We have 2 databases, say DB1 and DB2.
DB1 contains all the stored procedures which access also data in DB2.
DB1 uses synonyms to access the tables in DB2.
(Using synonyms is a requirement in our situation)

This works perfectly fine in all situations with SQL Server 2005 Developer Edition.

However in the Express Edition, we get an exception when we do the following:
1 Restart SQL Server
2 Execute the following code within DB1:

set transaction isolation level snapshot
begin transaction
declare @sQuery varchar(max)
set @sQuery = ‘Select * from synToSomeTableInDB2’
exec (@sQuery)
commit transaction

This will result in the following error:

Snapshot isolation transaction failed in database ‘…’ because the database was not recovered when the current transaction was started. Retry the transaction after the database has recovered.

The same select query passes fine when used without the EXEC or when run on the Developer Edition.
Restarting the server in step 1 is important as once a connection was made to DB2, the code runs also fine on SQL Server Express Edition.

Does anyone have an idea what this is? We need to be able to use EXEC for some dynamic queries. We’ve already checked MSDN, searched Google, … Any help is greatly appreciated.

— Edit: March 10 09
As discussed with Ed Harper below, I’ve filed a bug report for this.
See https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=422150

  • 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. 2026-05-11T11:19:18+00:00Added an answer on May 11, 2026 at 11:19 am

    As found out via Microsoft Connect, the problem is that by default on SQL Server Express Edition the AUTO_CLOSE option is set on true.
    Changing this option to false fixes the problem.

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

Sidebar

Related Questions

Lets say we have two databases, one named db1, the other one named db2.
Let's say I have two databases with identical tables, but one database's tables contains
I have 5 databases which represent different regions of the country. In each database,
Lets say I have two MySQL databases with some complex table structures. Neither database
Let's say I have some update script: update sometable set somecolumn = 'somevalue' where
I have two different schemas in Oracle (say S1, S2) and two tables in
I have some databases that have four files each; one for PRIMARY, IDX, IMAGE,
I have two databases, production and stage. I am getting the error message in
I have several databases (SqlServer 2005) on the same server with the same schema
I have a server with about 3 replications configured. 3 databases being published to

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.