Re: Same transaction on 2 different DB

From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 10/20/04


Date: Wed, 20 Oct 2004 11:23:31 -0500

You are fine. Transactions work perfectly (as perfect as possible :) across
databases.

-- 
----------------------------------------------------------------------------
Louis Davidson - drsql@hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services.  All other replies may be ignored :)
"checcouno" <checcouno@discussions.microsoft.com> wrote in message
news:12FEFC48-0BA5-4BD4-88CA-B43BDF548FEB@microsoft.com...
> I've two different sql-server Db on the same server, i need to pass data
> between the 2 db. If i call a stored procedure on one of this DB tha begin
a
> tran, select insert and update some table from both the DB, this
transaction
> has effects on both DB or only in the DB in which the stored procedure is?
>
> Example:
> stored procedure mySP is on myDB1
>
> mySp1 code:
> ...
> begin tran
>
> insert into myTable1_DB1
>   (select * from myDB2.dbo.myTable1_DB2 where myField = myValue)
>
> delete from myDB2.dbo.myTable1_DB2 where myField = myValue
>
> commit tran
> ....
>
> Thanks


Relevant Pages

  • Re: Stored procedure
    ... the stored procedure. ... to use in ISAM databases (yes... ... fields are not used in SQL Server except in rare situations. ... > @Param3 money, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Stored procedure
    ... Thanks Nick, I actually did create them in the sql server, I just didn't how ... > the stored procedure. ... > to use in ISAM databases (yes... ... >> @Param3 money, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Question about move large amount of data from database to database
    ... And The stored procedure is here: ... BEGIN TRAN ... database table to another database table every week. ... Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books ... ...
    (comp.databases.ms-sqlserver)
  • How to query two SQL Server instances
    ... I need to run a stored procedure, or make it simpler, to run a query to ... access the databases from two machines location at different locations. ... On client's machine A, say in city A, have installed SQL Server, another ... the databases in head office? ...
    (microsoft.public.sqlserver.programming)
  • Re: Error handling
    ... stored procedure, and cause an exception to be returned immediately to the ... > I'm having trouble with simple error handling in SQL Server. ... > ROLLBACK TRAN T1 ...
    (microsoft.public.sqlserver.programming)