473,396 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Transaction across 2 databases?

Is it possible to wrap a transaction across 2 database? For example:

BEGIN TRANSACTION

.... alter something in Database_1

.... alter something in Database_2

COMMIT TRANSACTION
or if there is any error:
ROLLBACK TRANSACTION
Jul 23 '05 #1
3 8860
Robin Tucker (id*************************@reallyidont.com) writes:
Is it possible to wrap a transaction across 2 database? For example:

BEGIN TRANSACTION

.... alter something in Database_1

.... alter something in Database_2

COMMIT TRANSACTION
or if there is any error:
ROLLBACK TRANSACTION


Yes, just go ahead.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
I don't know why but I was under the impression you couldn't do this! (Under
the impression for the past year while I've been developing my software
while looking nervously at the size of the crack between one database and
the other, through which partially completed operations might fall!). Well,
good news indeed.

"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn*********************@127.0.0.1...
Robin Tucker (id*************************@reallyidont.com) writes:
Is it possible to wrap a transaction across 2 database? For example:

BEGIN TRANSACTION

.... alter something in Database_1

.... alter something in Database_2

COMMIT TRANSACTION
or if there is any error:
ROLLBACK TRANSACTION


Yes, just go ahead.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 23 '05 #3
Robin,

Transaction is a server wide concept rather than database wise. It is
perfectly valid to have cross database transaction. As a matter of fact,
one can even condutc cross server/apps distributed transaction using MSDTC
(BEGIN DISTRIBUTED TRAN).

--
Gang He
Software Design Engineer
Microsoft SQL Server Storage Engine

This posting is provided "AS IS" with no warranties, and confers no rights.
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:cs*******************@news.demon.co.uk...
Is it possible to wrap a transaction across 2 database? For example:

BEGIN TRANSACTION

.... alter something in Database_1

.... alter something in Database_2

COMMIT TRANSACTION
or if there is any error:
ROLLBACK TRANSACTION

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
3
by: Evelyn Pabón | last post by:
Hi I created a database application for the company I'm working and as part of the CFR Part 11 it is a requirement for al the application that are for manufacturing us to have some security...
5
by: BashiraInTrouble | last post by:
Hi Friends, I have tried almost everything but I cant seem to shrink the transaction log. Executing DBCC SQLPERF(LOGSPACE) gives me this info: Database Log Size (MB) Log Space Used (%) ...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
6
by: Damon Grieves | last post by:
Hi I just want to be sure I understand how the Access client works. If I have an Access back end with a million records on a server and an Access client. If the client is installed on the users pc...
2
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
3
by: peterc | last post by:
I have an existing database with approx 500,000 rows and accessed by a few hundred users per day creating approx 1,000 new records per day plus typical reporting - relatively low volume stuff for...
19
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! I'm using DB2 database on one server and ORACLE database on the second one. I want to move some data from ORACLE database to DB2 database and update some columns on ORACLE database so I know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.