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

Top 5 Contributors of the Month
Post New Web Links

SQL CE web sync pull subscription fails to initialize with "value violated the integrity constraints

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

I was torn whether to post this to a SQL CE or the SQL Server Replication forums, but all my attempts to isolate this failure mode in test cases using pure ADO.NET against SQL CE have been unnsuccessful, so I'm leaning toward this somehow being related to an interplay with merge replication.

Some of this background may not relate to my specific failure, but I'll err on being thorough: My topology is SQL Server 2008 R2 running Merge Replication with Web Synchronization using the SQL Server Compact Edition 3.5 SP2 Server Tools, and SQL Server Compact Edition 3.5 SP2 for the client DBs on full Windows XP or later OS’s.  We have 150+ articles, each of which range from 10 published columns to close to the 255 limit. Regarding filtering, we have a root article filtered on the hostname, which then has 2 levels of join filtering cascading off that.  We are using column level change tracking and with use_partition_groups=false (due to a major performance hit when doing DML updates on the server when this was "true") and we are not pregenerating snapshots for specific subscribers so that occurs on the fly for new subscribers.  Currently we have subscribers counted in the hundreds, but the end target will be thousands of subscribers across the US synchronizing over the public internet (including from air cards).

Now for my sp

View Complete Post

More Related Resource Links

Does Sync Center support for SQL Server 2008 R2 Express Edition pull merge subscription?



I have create a subscription (pull, merge replication) on SQL Server 2008 R2 Express Edition to a publication on SQL Server 2008 R2 Enterprise Edition. I have seen that the subscription has been enabled for Windows Sychronization Manager as I can see in its property dialog. However, I cannot see it in the Sync Center of Windows 7 on the Subscriber.

Does Sync Center support in this scenario? From another thread, it seems we need to use Windows Task Manager. If so, how can I set it up?

Thanks in advance.

Please mark replies as helpful or answers if they are helful, doing so can help others encountering the similar issue.

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

Windows sync management is not picking up pull subscriptions with windows management sync property e


Hi there,

I have a Sql server 2008 R2 Std and  sql server 2008 R2 Exp on clients.

on client workstations, there is a  pull subscription with  enabled "use  Windows synchronization manager" property.

The problem is  that windows sync manager always comes up with "There are no offline items to synchronize." and I'm wondering why is that it's not picking up the subscription.

Any idea would a great help



User Profile Sync - Fails on ilmbuilddatabase


Setting up user profile service.

Following the excellent harbar guide as usual which normally results in a working service.

The service gets stuck on starting when provisioning (go to services and server and start as the farm account)

Looking at the uls the following steps work well.

User Profiles 9i1y Medium ILM Configuration: Validating account. 
User Profiles 9i20 Medium ILM Configuration: Validating the system groups 
User Profiles 9i23 Medium ILM Configuration: Setting up WMI 
User Profiles 9i24 Medium ILM Configuration: Setting required permissions 
User Profiles 9i26 Medium ILM Configuration: Create install config file 
User Profiles 9i28 Medium ILM Configuration: Update source project 
User Profiles 9i29 Medium ILM Configuration: Changing service account credentials 
User Profiles d3bo Medium ILM Configuration: Setting policy for service account 
User Profiles 9i2a Medium ILM Configuration: Configuring database 
User Profiles 9i2b Medium ILM Configuration: Re-starting mms service 
User Profiles 9i2d Medium ILM Configuration: Checking mms service 
User Profiles 9q1e

How to initialize merge subscription locally?


This is the scenario that I'm trying to get working:
1) Publisher = SQL 2008 SP2, Subscriber = SQL 2008 Express, Replication = merge replication (pull) + subscribers get filtered data with Host_Name()
2) When a new subscriber connects to the publication, the publisher will generate a compressed snapshot
3) I will then manually download the compressed snapshot via passive FTP-SSL (as far as I know, merge replication only works with active FTP, please correct me if I'm wrong)
4) Once the snapshot is downloaded, I will perform the initial syncrhonization and apply the snapshot locally from the downloaded cab file

I'm having a problem with the last step in my scenario. I'm getting this error:
You cannot specify an alternate snapshot folder (-AltSnapshotFolder) or the partitioned snapshot folder name (-DynamicSnapshotLocation) when the publication has one or more articles that use non-overlapping partitions that are unique for each subscription (@partition_options = 3).

All the information that I have found on the web, suggests that this scenario is possible. Although for step 3, a removable drive (cd/dvd, usb drive) is suggested instead. But detailed information for step 4 is nowhere to be found.

As for the error itse

Initial SQL Server replication over https fails with "subscription to publication 'xxx' has expire


Set up

SQL Server 2008 standard 64-bit on machine A, acting as both publisher and distributor (Windows 7 Professional 64-bit)

IIS 7 on machine B in same domain as machine A (Windows Server 2008 R2 Standard 64-bit).

Subscriber running on Sql 2008 Express on notebook running Windows 7 home, does not belong to any domain

If I hook up the notebook to the internal network, and use the SSMS "New Subscription Wizard", everything works correctly (I connect to the publisher using an SQL account)

If I then delete the subscribtion on the notebook, and recreate it on the notebook outside the firewall (using the script generated by the wizard in the step above), and initialize the replication from outside the firewall it STILL works correctly.

However ...

If I create a new publication on the publisher, and try to initialize the replication on the subscriber outside the firewall (using the same script from the wizard), I get the error noted in the title.

Again, I am using a script to create the subscription which was generated by the new Subscription Wizard, and I am running the same batch file on the subscriber to run replmerg.exe to initiate / replicate in both scenarios.

So, as far as I can see, everything is identical, including all the security accounts used.

It seems that somehow

create subscription on client creates no entry in Sync Center if there is another SQL Server 2008 R2


We created a publication on SQL Server 2008 R2 (Dev. Edition). Then we tried to create a pull-merge subscription on the client which should create an entry in Synchronization Center (Win 7) as well under Windows Explorer – Synchronization (Win XP).


This scenario works if there is only our instance of SQL Server installed on the client.

If there is another instance (default or another named instance) installed before we create our instance with subscription there is following strange situation:


-       Subscription is created properly within Management Studio, property for showing in sync center set to enabled.

-       No entries created in Synchronization Center or Win Explorer Synch.

-  &nbs

On SQL Server Express 2008 R2 and Windows 7 x64 replication subscription does not show in Sync Cente


I am running SQL Server 2008 Express R2 64-bit on Windows 7 x64, and I've created a subscription to a database publication on a Windows Server 2008 with SQL Server 2008 R2 standard. The subscription created fine on the Windows 7 machine in SQL Server Management, but it does not display in the Sync Center. I have set the subscription to "Use Windows Synchronization Manager" and recreated the subscription several times, but it never shows up.

I've searched for hours and I cannot find any answers to this. Has anyone else run into this problem? Is there a step I'm missing?


Initialize Subscription Failing


When I create a subscription for a Publication I am receiving the following error: Concurrent snapshot for publication <Name> is not available because it has not been fully generated or the Log Reader Agent is not running to activate it.

The snapshot has completed, and I have recreated the snapshot multiple times. The Log Reader is running without apparent problems, but continue to receive this error message.

Does anyone have any ideas why this error is occurring?

ToggleDebugCompilation fails trying to perform "an unauthorised operation"



We're having a problem with the Visual Studio 2008 RTW version of the web deployment projects on a colleagues machine. The project works fine if I run it on my machine, but when he tries to run it on his machine he gets:

<SNIP : Most output removed>
  Task "Exec"
    if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
  Done executing task "Exec".
  Using "ToggleDebugCompilation" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.Tasks.dll".
  Task "ToggleDebugCompilation"
    Updating Web.config <compilation> element debug attribute to 'True'.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error : Attempted to perform an unauthorized operation.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: The "ToggleDebugCompilation" task failed unexpectedly.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: System.ArgumentNullException: Parameter "message" cannot be null.
    C:\Program Files\MSBuild\Microsoft\WebDeployment

ArrayList.ToArray fails!


In my app, I have code similar to the following:



               ArrayList alStartFrames = new ArrayList();
                byte[] abytTest = { 1, 2 };


                byte[] abytCombinedFrame = (byte[])alStartFrames.ToArray(typeof(byte));

            catch (Exception ex)

The call to ToArray always fails and the exception is caught even though I'm pretty sure alStartFrames is an array list of byte arrays. Anyone have any insight on why this is happening?! TIA

In Sync: Creating Synchronization Providers with the Sync Framework


The Sync Framework can be used to build apps that synchronize data from any data store using any protocol over a network. We'll show you how it works and get you started building a custom sync provider.

Joydip Kanjilal

MSDN Magazine August 2010

Sync Up: Manage Your Data Effectively With The Microsoft Sync Framework


Synchronization Services for ADO.NET provide a set of tools to help you synchronize data between two database sources, synchronize files between machines, and synchronize with an RSS or ATOM feed. Learn more here.

James Yip

MSDN Magazine April 2009

routing fails



I am trying to compile and run an asp.net application and am getting the following errors

 HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

I have a starting URL of http://localhost:61431/WebSuds/Suds/Welcome and routing code

"Default",                                 // Route name
"{controller}/{action}/{page}",            // URL with parameters
new { controller = "Suds", action = "Welcome",

Is Conditional Subscription possible in SSRS 2005?


Hi Guys,

Is there a way to set up a subscription that will send e-mails based on the contents of a report? For example, I want to schedule a daily subscription that will only send an e-mail if the report contains data, otherwise it will do nothing for that day. i.e If the report has more than one row, it should send the mail otherwise it should not send the mail.....

Is it possible in SSRS 2005 or is there any other way to do it???


Using Infopath form fieldnames in a workflow fails



I designed a form in Infopath and I published it on a SP2007 server to use in a workflow in a library. That goes fine. In the workflow I send an email message. I can use the fields from my Infopath form in the message that I create. 
If the workfow is starts, Shrepoints sends me the message. But it does not use the fields from my InfoPtah form in the message in stead I see questionmarks.

Why doesn't it show the fields?

I alse saw (maybe this makes it clear) that when I let it dipslay the URL in the message, it show: http://1.portal.lucasonderwijs, but the actual site is whithout the "1" and it should also start with https://

Has anyone seen this before?

Thank you,


Crawler fails to register date properties of user profiles with the month of January, April, August


This seems to be a bug when the crawler search the user profiles in MOSS 2007.  When crawled, user profiles with a SPS-HireDate in the months of January, April, August and December will be detected, but a full-text (SQL) search returns those profiles without the HireDate field.

User profiles with HireDates in other months work correctly, returning the HireDate in the search.  And changing the month of a problematic user profile also fixes the problem.

This problem is also reflected in the fact that while we have 499 user profiles using the SPS-HireDate property,  the managed property page from the search section only has 350 items with the HireDate property.

We're running MOSS 2007 32bit with SP2 with an English language base and the Spanish language pack. I'd considered date format problems, but I can't imagine how some months would work, while others wouldn't.

Any ideas?

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