.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to get transaction replication latency value from code behind?

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Sql Server


I'm using transactional replication only for reporting purpose (DB1 (publisher) ->DB2 (Subscriber).For Some function really on the latency time to select data from DB2.That mean When user click one button it will update in DB1 first then by the changes it will read from DB2.So now I have hard code the wait time to read from DB2 after update in DB1.What is the correct way to solve the problem. Is any way to get the latency time from Distributor from code behind?

View Complete Post

More Related Resource Links

Reinitialize transaction replication clear the subcriber data and replicating again

Hi all, I add new table in to mu publisher database and reinitialize the subscriber.And i select the option to create new snapshot and marked as reinitialize.When it starts the reinitializing it clear all data from subscriber and coping again.Am i missing any thing here to add new table into existing replication ? Regards, Theesh

SQL 2008 Transaction Log too big from Replication

How do I clear transactions from log due to a failed attempt to setup replication?

which is best Snapshot Replication or Transaction Replication for my requirement?

Hi,    We have a main transaction database where all the live data is there.Now, to run a reporting application,we need a  different database, but the data is as EXACTLY as the live database.So,probaly every noght aroung 1 0'clock,we want to sync these two databases.   In this scenario,which is better, Snapshot replication or Transaction Replication? what are the pros and cons of using them? As I am new to this things,ur answers would be very much helpful..

Serve to server Transaction Replication error


I have windows 2003 sp2 servers each hosts SQL Server 2008 SP1 standard edition. I am trying to replicate both servers, using the tutorial available in the online documentation <Tutorial: Replicating Data Between Continuously Connected Servers> which can be found at: ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10rp_1devconc/html/9c55aa3c-4664-41fc-943f-e817c31aad5e.htm

I have created the users (repl_logreader, repl_distibution, repl_snapshot, and repl_merge and setting their security. Then I have created the distibutor, setting database security as mentioned in the document, and last creating the publication with a snapshot to be run immediately, distributor and publisher are on the same server and the publication will be pushed to the subscriber. Once the publication is created succesfully, I am checking the agents to see the errors. I am always stuck with the following two error messages:

1- snapshot agent error:

Error messages:

Message: Failed to create AppDomain "mssqlsystemresource.dbo[runtime].1090".
The domain manager specified by the host could not be instantiated.
Failed to create AppDomain "mssqlsystemresource.dbo[runtime].1091".
The domain manager sp

Bi-Directional Transaction Replication?


hi all

i want to know how to reslove conflicts when using Bi-directional transactional replication ,,conflicts like

1-If you insert a record that has a key into a table on one of the servers and another record that has the same key already exists on the other servers that participate in the replication, the replication does not propagate the changes to the other servers.

2-When you update a column in a record that is updated at the same time on another server, the data may be different on the two servers.

3-When you update different columns in a record, simultaneous updates of different columns of a record may sometimes lead to conflicts.

4-When you delete a row that is being deleted at the same time on another server that is participating in the replication, the replication fails because the DELETE statement does not affect any rows on some of the subscribers.

..i need help to know what to do to handle this conflicts and if there is any implementation or any ideas about this issue




Transaction Replication


Hi Team,


i have one dought


publisher is 2008 subscriber is 2000 data will be published or not

because we are going to configure this t-replication. suggest me.





Transaction LOG shipping of a Std. Transactional Replication


I have a primary database replicated to another server where I have added legacy data to the subscription. 

1.Can i perform Tx Log shipping of this subscription  to another server?

2. Republishing of the subscriber was very hard to maintain and throws errors when ever the servers involved are restarted. Can Log shipping help in this respect? 


3. Question: Can we add static data to the subscriber when using LOG shipping? Thanks

Latency on Replication Monitor(Transactional Replication)


Latency shows around 18 hrs today on the replication monitor and status shows Performance critical.Is that mean the subscriber is 18 hrs latency when compared to the publisher?Will it catch up eventually?

Thanks In advance.

Changing column Data Type when using merge replication: RFC on my SMO code.


I maintain an application for that uses SQL 2005 / 2008 for data persistence.
Some clients use Merge Replication (pull or push) to replicate data.

Some of the data the application stores should be "versioned". All versions of a row containing medical information should be stored, somewhere in a database. This means all updates and deletes to those rows should result in in 2 affected rows:

  • a copy of the row before the change
  • a row containing the change (or the deletion of the row in question)

I plan to achieve this using triggers on all the tables for wich "versioning" is required.
The old versions of a row may be stored in the same database, an other database (or a database on a linked server).

Unfortunalty, the AFTER UPDATE, DELETE triggers do not support TEXT, NTEXt an IMAGE data type columns.
Thus I am required to convert all text, ntext and image columns to their respective "new" data types, varchar(max), nvarchar(max) and varbinary(max).

This is not a big issue when the database is not published, but when it is... most articles (and posts) i've read suggest:

  1. Add a column of the target data type to the table, copy data from source column. rename columns and drop the source column.

  2. Create a temp table (with the s

Newbie question: Are there any code changes required in an app when introducing SQL Replication?



We are investigating introducing SQL Replication (transactional model) to mitigate the usage of our main database from a remote site (so, we would have a replication at the remote site).

What we want is for users to write only to the Publisher, and read from the local Subscribers.

I have just assumed so far that SQL Replication will be completely transparent and handle the replication internally, so that we won't need to change anything in our client applications connecting to the DB, but I can't actually find any documentation that confirms this (it just seems to be the most obvious way for this to work).

Can you please point me to some documentation that clarifies this, or just confirm the actual behaviour here?

Thank you!


error occurred while I tried to setup transaction replication with updateable subscription

   when I tried to setup transactional replication with updatable subscriptions between two nodes, an error occurred.

The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "REPL1 " was unable to begin a distributed transaction. Changed database context to 'database1'.

OLE DB provider "SQLNCLI" for linked server "REPL1" returned message "No transaction is active.". (.Net SqlClient Data Provider)
 May I know whether in order to setup transactional replication, do I need to run replication agents under domain users or local users?

thank you

Transaction Replication Deadlocks


Hi All,


Recently we have moved our Primary DB system from SQL 2005 single Instance Running on windows 2003 to SQL 2008 2 Node Cluster Running on Windows Server 2008.


Server Config as below:

HP DL380 G6, 2*4 Xeon X5550 2.67 GHz with 44GB Ram running SQL Server Standard Edition. Connect to HP MSA 2012FC - Dedicated SAN. Hyper threading is disabled.


We have transaction replication configured from the Primary DB server to 2 subscribers and from there to 8 Different Servers.


Change in transaction replication articles without enabling the enable Schema Replication to true


We have a transactional replication database where in we have set the schema change property to false. Now we have added a new column and to the table and wanted this column also to be replicated. But before enabling the allow schema replication parameter, we have altered the article added a column.

Now we reliazed that we have not enabled the sehema replication option. The database is very large and reinitializing the subscription remains our last option.

Could anyone suggest us the right way forward.

Thanks in advance.


Can replication cause transaction log to grow unchecked?


In short, can replication cause a transaction log file to grow and not be shrinkable?  Specifically:

My database (now SQL 2005) had done fine for several years.  The transaction log would occasionally get too large, and I'd back it up and shrink it.  The "initial size" was something less than 10 MB, and so the file could shrink to a small size.

A few months ago I set up the database as a publisher and a distributor to replicate to another server.  It's a snapshot push replication (runs continiuously, replicates once daily).  I think it's around that time that the transaction log starting growing significantly, and the "initial size" increased.  Now the "initial size" is around 12 GB, over 1000 times larger than the actual original "initial size".  Since SQL doesn't allow the transaction log file to decrease in size less than the "initial size", it won't shrink.  It doesn't seem good to have an MDF size of 3 GB and an LDF size of 13 GB.

I tried many things to resolve this, and got help from another Microsoft SQL forum, but no solution.

When I run dbcc shrinkfile, it generates the message "Cannot shrink log file ... because all logical log files are in use".  Is it possible that the replication is what's keeping the logical log file

Transaction Replication ADD col ....


Hi Team, In transaction replication in Publication database i want add one column on one article how can i add col in the article. (we need to add constraint not null also )

(we need to how can we update this new column in subscriber database through distribution same article please guide me..(Transaction Replication) Thanks in advance... tx


SQL server 2005 transaction replication requirements


Hi All,

Please any one how have information if that the SQL server 2005 transaction replication require windows server Enterprise Edition, is that right on not ?



Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend