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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:32:07+00:00 2026-06-10T13:32:07+00:00

Given a SQL script: Start a transaction. It is initiated from server X Do

  • 0

Given a SQL script:

  1. Start a transaction. It is initiated from server X
  2. Do a select into from a query involving table A into table B (= new table)
  3. Select table A into table C (= new table)
  4. Commit.

No errors happen. This is NOT a distributed transaction yet, since everything happens on 1 server.

Now let’s say 3. becomes:

  1. Select table A into table C, but table C is on a different server (I have to do this via EXECUTE('SELECT * INTO ...') AT [remoteserver] because 3 prefix syntax is allowed in the FROM clause but not in the INTO clause)

Now SQL Server tells me this statement (3) generates a conflict with another statement in the (now distributed) transaction.

To show you where the error is coming from and to prove that distributed transactions do actually work on my setup I now comment out step 2) !

Now the whole thing works. So step 2) makes the problem occur. But step 2) basically only does a joined select on table A and some other tables to generate table B and nothing else.

Why cannot step 3) execute without problems in that case (in the distributed transaction version), but the same non-distributed transaction version works flawlessly? And what conflict can there possibly be?

  • 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-10T13:32:09+00:00Added an answer on June 10, 2026 at 1:32 pm

    OK guys. Found out the problem, and it is interesting. It was something else. I did not mention that I also created table A, because I thought it had nothing to do with the problem, so:

    Replace step 2) with

    2) Create Table A **with** a primary key.
    

    Now the non distributed version works, the distributed version does not (step 3 that is).

    Replace step 2) with

    2) Create Table A with **no** primary key
    

    Now both versions work fine.

    But I don’t care really because the whole thing also works when I create the table with a primary key somewhere before the transaction. It is just that creating the primary key with the create table statement in the transaction causes 3) distributed version to not work.

    If someone knows why please write it here 🙂

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

Sidebar

Related Questions

Given this SQL: SELECT * FROM mytable ORDER BY mycolumn, RAND() Assuming that mycolumn
Question: Given a SQL string like CREATE VIEW TestView AS SELECT value1, value2 FROM
Please explain the SQL query given below. I m new with SQL and struggling
I'd like a simple perl script / sub to read a sql server table
I am attempting to search a SQL table from a PHP script. the SQL
I am new to SQLite I have a .sql script file, details.sql , given
I have an powershell script which is executing sql scripts from a given folder.
i am running a script from visual studio 2008 to a sql server 2008
Given SQL as an input, I have to query a PostgreSQL database and return
I am wondering what rights should be given to sql server user for asp.net

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.