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

Top 5 Contributors of the Month
Post New Web Links

Read Uncommited on a Replicated Database

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Sql Server


MS SQL 2005 SP2.

The replicated database is used for reporting.  Selects only.  However, some of the queries take quite a while to complete and this causes the distributor to be blocked.


1)  On the particular queries that are long running (or maybe entire db) set isolation level to READ UNCOMMITTED.

2)  Set ALLOW_SNAPSHOT_ISOLATION on (for replicated db).  For long running queries SET TRANSACTION ISOLATION LEVEL SNAPSHOT.


1.  Even though replication only distributes committed transactions, could the process of applying the transaction still cause dirty reads?

2.  I am concerned about the overhead.  But, if I only allow snapshot isolation on certain queries, can I not be as concerned?


Thank You.


View Complete Post

More Related Resource Links

Failed to update database "Hist_OHLC_ASnapshot" because the database is read-only.

Hi there, I've got this ExecutionfailureException using the subroutine below. It's been suggested by Alok.   public void CreateSnapshotAlok ( string SourceDatabaseName )         {             ProvideSecurity.provideSecurity ( );             DoServer.GetSrvConnOrSwitch ( "master" );             /* This is to ensure that a database with same name does not exist which is not needed if one chooses unique name for snapshot each time.*/             if ( Globals.srv.Databases[ SourceDatabaseName + "_Snapshot" ] != null )             {                 Globals.srv.Databases[ SourceDatabaseName + "_Snapshot" ].Drop ( );             }             Database database = Globals.srv.Databases[ SourceDatabaseName ];             Database snapshot = new Database ( Globals.srv, SourceDatabaseName + "Snaps

replicate a standby / read-only database

I have a database that is being replicated with log shipping. The database is in Standby/Read-only mode. The logs are restored every 30 seconds. For the logs to be restored all users are disconnected. But I want to have continuous read access to the replicated database. So I thought: why not replicate the replicated database? This second replication can happen on the same machine or on the same instance, the only purpose would be having a copy for continuous read access. I have looked at mirroring and transactional replication, but these things do not give me what. Is there a way of replicating a Standby/Read-Only database with continous read access to the replica? Thanks in advance, Frans

Best way to send data to report server from merge replicated database

Hi ALL,              I have merge replication configured on database say Testdb on production server. I want data from testdb(merge replicated) database to send to report server. How can i accomplish this....Whts the best way to send data at regular intervals to report server.. Any suggestions plz TIA

Read Uncommited (Bulk insert) and Performance


Hi all,

I have issues with Concurrency.

there has been times when updates happen on my fact table while some users read data from it at the same time, it takes a very long time and there is some blocking issues.

1.My inserts happen as Bulk inserts. I would like to know if I change my query to use NOLOCK will it still be blocked by the Bulk insert when i read? so does Bulk insert do an exclusive lock, so i cant read data?

2. changing my query to use NOLOCK is it benefical?

Please help me

is it possible to import data into a replicated database


I have a 2005 database set up Ok for Merge replicataion and I need to add data from an Acess 97 database I have been using the wizard to import the tables to new tables then I have a script which appends the tables sometimes making small changes this is fine if the database is not replicable but will not work if it is.  I do need to keep all identiy fields
Some of these tables only have a couple of rows and their 'range' seems to be within the values in the table properties

I get error
The insert failed. It conflicted with an identity range check constraint in database 'My_MPC', replicated table 'dbo.TblLiqItems', column 'LiqId'. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent.


How to read PDF using Asp.net(C#.net) and store values in Database


Dear All,

Please try to guide me how to achieve this one. my application need to do reading the PDF document and want to store the values in Database.

Actually what happens is my customers sends me the OCR scanned copied in the form of PDF file. i need to read those scanned pdf files and store the customer information into my  table.

please try to help me how to do this..

Thanking uou,



Faild to update database , becouse the database is read-only.



I creat a WindowsFormsApplication that its name is Taxi_agancy

I attached a database file that its name is Taxi_Agency.mdf to my project from server explorer in Visual Studio . ( I add conection to data connections and select Microsoft SQL Server Database File) and in Database file name I enter my database file .

I created a stup project for it . When I install my application in another computer and I try to add some data to my Database from application interface I recieve this error :

Unhandled exception has occurred in your application . if you click countinue the application will ignore this error and attempt to continue . if you click quit the application will close immediatly .

Failed to update database "c:\program files\default company name\setup\Taxi_agency.mdf" because the database is read-only.

Migrate Replicated Database to New Hardware


We're still using SQL Server 2000 SP4.

Our publisher database hardware is very old now, so I need to upgrade it to a new server machine.

My question is how can I migrate the publisher database to the new server, such that the replication settings can be kept?

It's a local distributor server. And they're all push subscriptions, merge and transactional with queued updating.

The new server can have the same server name as the old one.

Please specify the steps to do it. Thanks!

Windows 7 Phone Database Rapid Repository Create Read Update and Delete


Download the code and a fully working example application from http://rapidrepository.codeplex.com/


  1. Introduction
  2. Set up the Rapid Repository
  3. Create, Read, Update and Delete
  4. how to shrink log file of database which is merge replicated



      i have merge replication configured on sql 2008. HOw i should shrink log file of replicated database.


Database is read-only.



I have been learning on how to use the new features of the .NET 2.0, and Well I using VS2005 and everything is pretty straight foward. I did a Membership webform where you log in and create users and roles etc. I installed the SQL Server 2005 express as my Data provider and thats where my Tables are. I used the aspnetsql_reg comand to integrate the server to this application. Anyway my problem started when i decided to copy my project to my IIS server and well when I run the app from the Browser tells me that he Database It's set to Read-Omly and therefore it cant update it. This happens right after log in. but then I open the App. on hte VS and it runs find.

This is the error:

 Exception Details: System.Data.SqlClient.SqlException: Failed to update database "C:\INETPUB\WWWROOT\ESPM\APP_DATA\ASPNETDB.MDF" because the database is read-only.

If anyone have any ideas I would really aprecciate.

SharePoint 2010 backup is failing - Error - "Unable to read full interval from database - Operation



I am having a problem backing up a site collection, when trying to backup the collection I get the following error "Unable to read full interval from database" and "operation is not valid due to the current state of the object".

The backup does run and manages to backup 182MB of the site collection and then the backup fails, it fails at the same point what ever backup method I use e.g. STSADM, Powershell or Central Admin.

I'm getting the same error whether I use CA "granular backup" or "Farm backup", and using either STSAMD or Powershell. I can backup CA or the mysite collection but not the Home Portal site collection. I even tried installing the commuvaults 2010 agents and running a commuvault backup but this is also failing. i have included the log file entry below.

Does anyone have any suggestions on what i can do to either fix the problem or an alternative way to backup the collection or farm, I am currently taking a full SQL backup but am not sure how reliable this is as I haven't tried to restore the sites. 

P.S. I am not using the "UseSQLSnapshot" parameter.

11/30/2010 09:34:25.23  OWSTIMER.EXE (0x17E8)                 

Is realtime SQL Server Replicated database usable realtime (not offline / single user mode)


Is SQL Server replicated (destination) database replicated by SQL Server Replication fully usable? Meaning it's not just for Disaster Recovery but is fully usable from various say BI / Reporting purposes.

In the essence it is exactly same as other replication engines and the destination database is very much usable and not just offline / single user mode.



Change database state to / from Standby / Read-Only to Normal


I've got log shipping running as part of my DR strategy and the recovery database shows up on the DR server in Standby / Read-Only mode.  In the case of distaster how would I change the database from Standby mode into Normal mode?

The database is almost 10GBs and I'd like to test out a recovery while being able to then turn the database back into recovery mode after the test.  Is that possible?




Steve Berg

Follow Steve on Twitter

How to create a web service that read each records in a database


Hi there,

I would like to create a web service that reads each record in MSSQL and display it in a web control, any suggestions?

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.
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