.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

Initializing a Merge Subscription Without a Snapshot - doesn't operate correctly

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


I do the backup from the publisher, next I restore it at the subscriber using *pure* database.

next I attempt to create subscription using this db. of course, I use

SubscriptionSyncType.None for SyncType propery of the subscription.


1. nevertheless the merge agent downloads whole snapshot!

both data (bcp files) and the schema.

2. I get the *strange* error. below thelines from the log:

Applying the snapshot to the Subscriber

A dynamic snapshot will be applied from 'C:\DOCUME~1\...\LOCALS~1\Temp\DB$MAIN_DB1_Main_testReplFromBackup\'

Preparing table '__UserSyncOptions' for merge replication

Applied script '__UserSyncOptions_2.cft'

{call sp_MSsetconflicttable (N'__UserSyncOptions', N'MSmerge_conflict_Main___UserSyncOptions', N'DB\MAIN', N'DB1', N'Main')}

{call sp_MSsetconflicttable (N'__UserSyncOptions', N'MSmerge_conflict_Main___UserSyncOptions', N'DB\MAIN', N'DB1', N'Main')}

Incorrect syntax near 'Id'.

The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When trou

View Complete Post

More Related Resource Links

Merge Replication, Push Subscription : The snapshot takes centuries to apply

Well, not centuries, except that the users are storming the gate. I'm trying to find how to get the snapshot moved to the subscriber and applied in a reasonable time. Last time was successful, but took 2 1/2 days to build the subscriber database from the snapshot. Hillary responded: Something is very wrong here. You should be able to generate your snapshot, copy it manually over to the subscriber - using the altsnapshotfolder parameter and then apply it there. So now I have my snapshot, a folder with lots of .cft .bcp .dri .prc .sch  and .trg files. Getting this to the subscriber computer shouldn't take long. Once I get it there, how do I use it to get the subscriber set up?  You can't be successful at this unless you're at least 1/2 a bubble off level.

Snapshot while initializing a MERGE is not appled to the subscriber




2x SQL2008R2 SP2. (Box 'A' andf 'B')

'A' has a database 'C' which is to be replicated onto 'B'. 'C' has only 8 Articles (4 tables, 4 views).

I set up a Merge-Replication (Publisher and distributor is 'A'), subscriber is 'B'. Snaphot is to be transferred via FTP.

When creating a new pull on 'B', i want to use a new database (selected "new database', 'D'). 'D' should then be initialized with the snapshot which has been generated while creating the publication.

Unfortunately, the snapshot will not be applied to 'D'. The agent just starts to replicate the database. But since the new (empty) database 'D' is missing some tables, i receive an errormessage, that the view cannot be inserted due to missing components.

This is correct since the snapshot was not applied to 'D'. If i prepare 'D' manually to include the tables and views, the replication works fine, data is being copied between 'A' and 'B' and vise-versa.

But setting up a SNAPSHOT-publication for database 'C' on box 'A', then creating a snapshot-pull-subscription for this on box 'B' into 'D' , the snapshot will be applied  as expected.

I used the same permissions (SQL-Agent, etc.) for both publications/subscriptions.

Ans hints for troubleshooting ?

Thanks in advance !


Merge Replication: How to give read access on snapshot share to a sql account

Hello All, I want to give read access to an sql account(not windows account). Can it be given or not. Someone please tell. Thanks saandii777

Merge Replication: Fails using Replication.SaveProperties when changing Subscription Info

I'm trying to use SQL Server/Compact Framework 3 Merge Replication functionality and am running into a problem when calling Replication.SaveProperties (using c#). I was hoping to get some clarification on whether its my interpretation on how things should work vs a coding problem. Basically, the Merge Replication seems to work as I can sync information between my handheld and server databases.  However, I've created a form on my handheld so that the user can change some synchronication settings (e.g. Publication or Publisher Name) and then save it.  What I've noticed is : 1) You can NOT call Replication.SaveProperties until after a synchronization is performed (otherwise you get an error message).  Assuming this is so that it can create the "__sysMergeSubscriptions" table. Does this sound right? 2) If I then try to change the saved Subscriber information via another call to Replication.SaveProperties (e.g. change the Publication info), I then get an error message that says: The subscription was not found. Publisher, PublisherDatabase, or Publication  could be incorrect. Is this normal behavior?  Does this mean that you can you NOT change subscriber information; only add or drop it? Thanks,  Ed

Another merge agent for the subscription or subscriptions is running, or the server is working on a

Hi All, Using Merge Replication over the web (https). Server is running SQL Server 2008, client using SQL Server Express 2008. I am getting these error messages while trying to synchronize, and it won't let me sync: {call sp_MSensure_single_instance (N'{459D0BBA-53EC-4F65-AF52-E7DA478841DA}', 4)} Another merge agent for the subscription or subscriptions is running, or the server is working on a previous request by the same agent. Can you please advice what can be done to fix. Do I need to kill a process in SQL Server?

Cannot make use of the Merge Task correctly

Hi All, I'm Testing the Merge Task and here is the situation I have two sources one is an SQL  table CREATE TABLE MyTable ( Identifier INT NOT NULL IDENTITY(1,1), Content NVARCHAR(20) )  the other one is a flat file that has content suitable to that above tabe, For the SQL table I used an OLE DB Source and I specify a sql command to retrieve the data, the sql commad is as follow:  SELECT     Identifier, Content FROM         dbo.MergeTable ORDER BY Identifier, Content As you can see the command sorts the data. In the other side (The flat file) I added a sort transorm that recieves data fom that flat file and I configured that sort task to sort data exactly like the ole db one. Now the problem is when I tie the both inputs to the merge task then this last one still raise the error Error 4 Validation error. Data Flow Task Merge [923]: The input is not sorted. The "input "Merge Input 1" (924)" must be sorted.   DlmCustomer.dtsx 0 0  Inspite of the fact that the ole db source data specifie a command that sort data??? Thank you   The complexity resides in the simplicity

SSRS Report based on SSAS Cubes doesn't show NULL values correctly

I have a SSRS report which is based on an SSAS Cube. In the Cube the formating of numeric fields that NULL values are properly shown as NULL values. In the Cube Browser and Excel this is shown correctly. However when I design the report already the query against SSAS shows these fields as "0" instead of NULL. Is there a way to fix this or is this a bug ?  

Merge Replication Compressed Snapshot

Hi, How do I go about compressing my snapshot files? I am unable to find a tutorial explaining how to do it.

Can't get merge subscription to start pulling changes

Hello! We have two servers running SQL Server 2008 Standard.  I am using merge replication to replicate the entire database (11 GB, 350 tables) from Server 1 to Server 2 (pull subscriptions).  I have all the tables split up in about 10 publications.  I need about half of the database to be continuously updated every second, however, when I view the details of some of the tables in Replication Monitor I see a Download/Upload Progress bar that never gets to 100% and has an approximate time that keeps increasing.  I assume I/O is the bottleneck, so to test this theory I wanted to setup subscriptions on a new server we’ll be using for another project – which has a PCIe SSD (running SQL Server 2008 R2).  When I view the synchronization status on the subscriber (new server), I get the message:   “Skipping file TableName.sch' because it has already been delivered for a previous article or by a previously interrupted snapshot.” In Replication Monitor, the status is Running and the message in the Error Message column changes the table name (and script applied) in the message “Bulk copying data into table ‘DifferentTableName’”.  But the table names and scripts keep repeating themselves.  In the Error Messages field at the bottom of the window, I get: “The process was successfully stopped. (Sou

Logical HOST_NAME within Post Snapshot Script for Dynamic Merge Snapshot


I have a Merge Publication that is dynamically filtered based on HOST_NAME(). All subscriptions are push subscriptions (i.e all agents run in a common distributor)

In the definition of any Subscriber I can specify  the value of HOST_NAME() for the pupose of dynamic filtering. But HOST_NAME() in the Post Snapshot script appears to be the actual HostName of the Distributor (not the HostName of the Subscriber for whom that dynamic snapshot is intended).

How can I retrieve either the HOST_NAME for the subscriber as defined by the subscription, or the actual HOST_NAME() of the intended subscriber (either will do).

The processing performed by the Post Snapshot Script is conditional on which dynamic snapshot has just been invoked




SQL Server 2008 merge replication snapshot hangs on filtered articles


I have a publication on SQL Server 2008 Standard Edition using merge replication.  When I attempt to generate the initial snapshot, the snapshot agent appears to hang on the step "Setting up the publication for filtered articles."  I get a long (over 4 hour) series of messages: "The process is running and is waiting for a response from the server."  I know something is happening server-side, as SQL Server and the snapshot agent use a lot of memory and max out one core's processing capacity.

This has me confused as the publication is not doing any filtering.

Even more confusing:  I backed up the database and restored it onto my development-test system.  I created the snapshot there, and it took under 10 minutes every time.

Any suggestions for investigating and resolving this?

Login LayoutTemplate doesn't format correctly


The layout of my login control and LayoutTemplate must use widths in percentages:

        <div style="width:60%; float:left">
            <asp:Login ID="Login1"   
            <div style="width:100%">

But the LayoutTemplate wraps its Html in a table container so the source code looks like:

        <div style="width:60%; float:left">
            <table id="Login1" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
            <div style="width:100%">

The table has no width set so the cascade between the divs is broken and consequently the LayoutTemplate's Html does not format correctly.

If I manually set the table width to 100% it works fine.

How can I programmatically address the table to set its width to 100%?

I can use CSS with:

table#Login1 {width:100%;}

but this is very messy in my CMS application not least that ASP.NET changes the ID of the table to ct100_Main_Login1.

Your help would be much appreciated (any code snippets preferably i

Prevent subscription from synchronizing with snapshot automatically (RMO)



I'm trying to create a transactional replication topology using RMO. Everything is working well except for one thing: when I create a subscription it will automatically use a snapshot (that I generated before) to synchronize. I don't want this to happen because I want to be able to let my code wait for the synchronization to complete, so I want to trigger the synchronization process myself in the code. Starting the synchronization process manually can be done like this:

TransSubscription subscription = new TransSubscription();

// ... Set some properties first ...


However, if the subscription is already being synchronized (because it is triggered automatically as I mentioned before) then this code will throw an exception. I thought I had found a solution by first setting the agent's schedule to OnDemand, then execute the synchronization manually, and then set the agent back to Continuous. Setting it to OnDemand will prevent the automatic synchronization, but the schedule type cannot be changed anymore after the subscription is created, so it will still fail. The code was as

Mysterious Subscription - Merge Replication


Hi. I have SQL Server 2005 Standrad Editions publisher and 3 subscribers.

I had a publication with 3 subscriptions. For some reason i had to delete one of the subscription.

At the time of deletion for the first time on the publication server, it didnot return any errors.

Then when i tried to recreate it at the publisher, it gave me message that it already exists.

Now when i try to delete it at the publisher (both by seleting the check box to connect to subscriber n deleting or unchecking the check box), it fails saying there is no such subscriber.

I can go to the subscriber server, under replications and subscritpuions, i can delete it. But after few minutes or so, it shows up again automatically.

In replication monitor i donot see that particular subscription under the publication

In the Distribution database, i donot see the entry of the subscriber in MSmerge_subscriptions table

But in the database on which replication is taking place, i do see the jargon entries of the subscriber in the System table sysmergepublications.

When i delete those entries with delete statements, they show up again in the table after a few minutes.


I ran SQL server profiler to try and understand whats happening. My suspect is its something to do with the execution of the

Change merge subscription sync_type


I have merge subscription created from backup but I want that new article add to publication after subscription creation would be propagated like with sync_type automatic. Is there are way to do this.

Thanks in advanced.

Now each time I add new article I need to manualy transfer table to subscriber.


SQL 2008. Merge replication. Snapshot agent. Access Denied

Windows Server 2008 Standard x64 SP1, SQL Server 2008 Enterprise Edition x64 SP1
Snapshot agent has read-write permissions to ReplData folder but cannot access local snapshot folder. How to resolve this error?

Error messages:
Source: mscorlib
Target Site: Void WinIOError(Int32, System.String)
Message: Access to the path 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ReplData\unc\ServerName_DatabaseName_PublicationName\DateTime\' is denied.
Stack:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
   at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
   at Microsoft.SqlServer.Replication.Utilities.CreateDirectoryWithExtendedErrorInformation(String directory)
   at Microsoft.SqlServer.Replication.Snapshot.SnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
   at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: mscorlib, Error number: 0)
Get help: http

Custom Data Processing Extension doesn't show but should be registered correctly.



I have a custom data processing extension that i can't see to get to work. I followed the steps like in :http://msdn.microsoft.com/en-us/library/ms155086.aspx to register the extension. Yet the extension does not show up in the data source list.

It's an extension made for ssrs 2008 and I want to use it on a SSRS 2008R2 instance. I don't have any reasons to believe that I did not configure the extension correctly, it's the same as the article and and the same on my 2008 instance.

I am using Reporting Services standard edition 2008 R2 with cumulative fix patch 4 so that should support extensibility.

The data sources that I migrated from 2008 that still refer to the extension give a message saying that the extension is not registered or configured correctly. But i swear I did it right.

Any other extension that I use did register fine, none of them are DPE's though.


My config:


  <Extension Name="SecurityDataProce
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