Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Availability Groups and DR (2012)
 Cross-database task for AG databases

Author  Topic 

metravl
Starting Member

1 Post

Posted - 2013-08-25 : 16:56:11
We use SQL Server 2012 and its new Availability Groups (AG) feature. There is a task for moving old data of some tables from one database to another database. Both databases are included into different availability groups. Previously (before using the AG feature) the task was resolved by adding the second server instance as a linked server (sp_addlinkedserver) and executing a distributed transaction in the following way:

1. begin transaction
2. insert old data into server2.table2 from server1.table1
3. delete old data from server1.table1
4. commit transaction
Unfortunately, distributed transactions are not supported for AG because databases may become inconsistent in case of failover ([url]http://technet.microsoft.com/en-us/library/ms366279.aspx[/url]).

Is there some way to implement this task with keeping the AG feature and without implementing the rollback logic in case of exceptions?
   

- Advertisement -