Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am trying to run query to another

Status
Not open for further replies.

riska

Programmer
Apr 16, 2002
7
CZ
I am trying to run query to another database via linked servers.

Now, I am testing a script on the two databases on my machine.
(The linked server is localhost)

If I run query:

select * from openquery( data_source, 'select * from pubs') it goes.

But if I run query in transaction :

begin tran
(select * from openquery( data_source, 'select * from pubs')
commit tran

it raises error:
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
Line 1: The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.

thank you for help

joseph
 
Certain restrictions apply to distributed transactions. SQL BOL contains details. Start with the following page.


Why are you using a transaction for the select statement? Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
I need to migrate data from one database to other.
The whole migration is based on one entity with its relations.

The data copying must be enclosed in transaction because if I find the wrong data in related tables I'll do rollback and no data will be inserted into my base database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top