I have created a custom conflict resolver for an article that is using Merge replication. I can register my custom resolver OK, I can change my merge article to use my new custom resolver, but when a conflict occures the replication monitor shows the following errors:
Error messages:
No signature was present in the subject.
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2146762496)
Get help: http://help/MSSQL_REPL-2146762496
The Custom Resolver Component for article 'BRANCH' does not have a valid digital signature. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147198713)
Get help: http://help/MSSQL_REPL-2147198713
At first I thought it was because my assembly wasn't signed, so I signed it. I still get the same error.
I have various debug statements in the assembly and I can see that Initialize and HandleChangeStates gets called ok, but no other overrides.
I'm trying to create a custom conflict resolver for SQL Server 2000 in C# but i can't seem to find any source code examples of a *.dll where i can actually see what needs to be done.
I am working on a COM-based custom conflict resolver (vb.net) for a merge replication problem that I am having. This is what I am trying to accomplish. 1. Have a Last_Upd_Dt column. 2. When there is a conflict between publisher and subscriber on a column, the winner is the most recent date in Last_Upd_Dt and want the value for that column from that source. 3. If there is no conflict on a column and the column was updated by either the publisher or subscriber, I want to keep the change made by the publisher or the subscriber. (i.e publisher made change in col #1, subscriber made change in col #2, no conflict, the resulting row will now have the col #1 value from publisher, col # 2 will have value from subscriber. Essentially merging the changes.)
Does anyone have any examples of a COM-based Conflict Resolver that implements ICustomResolver for SQL Server 2005? Can this be done using the Business Logic Handler (examples?) ?
I created a stored procedure based custom conflict resolver in SQL 2005, I return the winning result set and also save that result set to a test table to compare the values. The values saved to the test table are correct but some of the values saved as the conflict winter are truncated.
Example a char(3) filed is updated at the subscriber as 111 and updated at the publisher as 222, in my custom conflict resolver if I use the value from the subscriber the conflict resolver updates the field as 11 , if I use the publisher value the conflict resolver updates the field as 22 . Now the same records is saved to the test table correctly as either 111 or 222 depending on the logic I used. So the result set has the correct values, its after the custom conflict resolver is called where the values is somehow truncated. Has anybody run into this before and what steps can I take to avoid this.
When conflict occur, I want the user to be able to select witch row to keep and witch to delete.
I've look for system stored procedure, that could help me do the resolution but I've founded nothing.
So I've thought that I could do it by hand, with UPDATE/DELETE query Take the row in the %TABLE_NAME%_Conflict table and copy it into the real table, than delete the row.
I'm trying to setup the Interactive Conflict Resolver in my C# app via RMO. (using SQL Server 2005)
The only article I can find on MSDN or anywhere is involing T-SQL. Can someone please shed some light on this for me specificaly on the subscriber side.
Hi, I'm replicating a database between two instances of Sql 2000 using Merge Replication. I have no custom resolvers at present but I'm seeing something unexpected.
I need to write a custom conflict resolver for an application using merge replication. It's relatively simple logic - compare the two rows from the publisher and the subscriber and the winner is based on the value of one particular column.
Reading BOL gives me the input parameter list for the sp, and specifies that the output should be exactly the winning row. What is doesn't give is any example of how to do this, in particular how to access the two rows in conflict so that they can be compared.
I can do this by dynamically building SELECT statements, one connecting to the table locally on the publisher and another connecting to the subscriber using the form SERVER.DATABASE.OWNER.TABLE, but this requires me to explicitly have the subscriber as a linked server to do this. An example of my revolting code is appended to this post.
Is this what I have to do, or is there some table I can access on the publisher that has the conflicting rows in so I can compare them without going back to the subscriber?
Thanks for your help
Richard
---- code sample --
ALTER PROCEDURE [dbo].[prRep_ResolveInventoryConflicts]
CREATE TABLE #ConflictingRows ( [Machine] [sysname]NOT NULL, [LocationID] [int] NOT NULL, [PartGUID] [uniqueidentifier] NOT NULL, [Qty] [int] NOT NULL , [LastUpdatedDtm] [datetime] NOT NULL, [LastUpdatedUser] [varchar](50) NOT NULL , [rowguid] [uniqueidentifier] NOT NULL
)
-- Build the T-SQL To run against publisher and subscriber
SET @Publisher = @@Servername SET @qryPublisher = 'INSERT INTO #ConflictingRows SELECT '+@Publisher+' as Machine, * FROM '+@tableowner+'.'+@tablename+ 'WHERE rowguid = '+CAST(@rowguid as varchar(40)) +';'
SET @qrySubscriber = 'INSERT INTO #ConflictingRows SELECT '+@subscriber+ ' AS Machine, * FROM '+@subscriber+'.'+@subscriber_db+'.'+@tableowner+'.'+@tablename+ 'WHERE rowguid = ' + CAST(@rowguid as varchar(40)) +';'
-- execute the stored procedures
EXECUTE @qryPublisher; EXECUTE @qrySubscriber;
-- Compare the two rows and return the winning row, ie the one that was last updated by a human checking the inventory
SELECT @RecentCheck = MAX(LastUpdatedDtm) FROM #ConflictingRows
SELECT TOP 1 * FROM #ConflictingRows where LastUpdatedDtm=@RecentCheck;
I see that MS has a conflict viewer that can be accessed by managment studio, however I would like to create one with some customized options. Is there a sample of code somewhere to start this? I could really find anything in BOL. Thanks in advance.
I have been evaluating merge replication, 'push' subscription on SQL Server 2014. If the default resolver is used (I refer to @article_resolver parameter of sp_addmergearticle), all seems to work as expected. However if I use "Microsoft SQL Server Subscriber Always Wins Conflict Resolver" (or any other MS standard resolver for that matter), if the Subscriber is on a different machine, the merge agent invariably gives the following error: "The process could not initialize <resolver_name>. Verify that the component is registered correctly."
This does not happen if the Subscriber is on the same machine as the Publisher and Distributor.
The problem seemed to exist in SQL Server 2008 according to some posts but it has been apparently fixed since then. I've tried the following:
- @partition_options = 0, as was suggested somewhere.
- Copied ssrpub.dll (the resolver dll) to the Subscriber machine (should not really matter as this is 'push' subscription?)
- Registered ssrpub.dll with regsvr32 on the Publisher/Distributor machine.
I've also run sp_enumcustomresolvers on the Publisher machine, and it happily showed all standard resolver, including the "Microsoft SQL Server Subscriber Always Wins Conflict Resolver".
Another thought is, I'm using SQL Server Express as the Subscriber (on the remote machine). Perhaps it does not support custom resolvers? (I'm using the full SQL Server in the 'local subscriber' variant, which does work OK as I mentioned before).
Note also that if I create a new publication via SSMS, the Resolver tab of the Article Properties dialog is empty, i.e. it does not list any resolver. The same tab contains the full list of resolvers though, if opened for an existing publication.
I have a custom conflict resolver - which fires on update conflicts (using row level tracking)
I have had a couple of occasions when the resolver has failed with the following error:
"The schema of the custom Dataset object implemented in the business logic handler does not match the schema of the source Dataset object. Verify that the custom Dataset object has been correctly defined"
In both cases I found that the row for which a conflict was being handled was not a conflict at all. One was a straightforward non conflicting update at the publisher and the other was a similar update at the subscriber.
I got round the problem by temporarily using a fix version of the conflict resolver dll that either set the custom Dataset to the publisher dataset or the subscriber dataset - depending on where the update had occurred.
When the first error (publisher update) occurred - the resolver code was basing the custom dataset on the publisher dataset - which was presumably empty - so I changed the code to base the custom dataset on the subscriber dataset. The second error therefore occurred when the custom dataset was based on the subscriber dataset - which again was presumably empty
Note that the tables involved in each occasion were different and neither table is filtered.
Is there a known bug in this area?
I am considering trying to change the resolver code to identify false conflicts in order to workround the problem - but this would be difficult to test as I can't reproduce the problem
here is the context of our problem: - Publisher : version SQL Server 2005 SP2, table in SQL Server 2000 (80) compatibility level, publication in SQL Server 2000 compatibility level - Distributor : SQL Server 2005 SP2 - Subscriber : SQL Server 2000 SP4 + hotfixes (version 8.00.2187)
There is only one article in our publication (a simple table with a GUID and a nvarchar(50) columns), and we have left the default resolver.
1 - The first synchronization of the subscription is successfully completed, and it is the same for the different updates/inserts/deletes or conflicts.
2 - Then we change the Resolver of our article by our own COM-Based Custom Resolver (developped in C# 2.0). This resolver only change the default behaviour: the subscriber always win (this is for a test, in the future we will have a complex business logic). All the synchronizations works fine and do what we want in the conflicts.
3 - We rollback the resolver to the default one... and here is the problem!
The synchonizations stop to work correctly. For all of them we've got the same error: quote:Replprov.dll , 2007/09/25 14:26:07.591, 4000, 16890, S1, ERROR: ErrNo = 0x80045017, ErrSrc = <null>, ErrType = 8, ErrStr = The schema script ' declare @cmd nvarchar(1000) set @cmd='exec sys.sp_MSchangearticleresolver @article_resolver=@ar, @resolver_clsid=@rc, @artid=@ai, @resolver_info=@ri' exec dbo.sp_executesql @cmd, N'@ar> nvarchar(255),@rc nvarchar(40),@ai uniqueidentifie..." mailto:N?@ar">N'@armailto:N'@ar">N'@ar</A< A>> nvarchar(255),@rc nvarchar(40),@ai uniqueidentifie...
It is no more possible to synchronize this subscription... Any remark will be helpfull cause we did not find anything on the net concerning this error.
I'm trying to create a custom resolver for merge replication exactly like in the MS example.
It seems to work, but only ONE time. If I change, insert or delete a record in a table the second time, the subscriber monitor comes with the following errors:
Error messages:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199411)
The Merge Agent encountered an error when executing code in the 'UpdateHandler' method implemented in the business logic handler 'D:Program FilesMicrosoft SQL Server90COMMyResolver.dll'. Ensure that the overridden 'UpdateHandler' method has been properly implemented in the business logic handler. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199411)
This last error is of course dependant on my action (update, delete, insert).
My code is -exactly- like the example (I just stripped out the log message).
Does anyone know why I am "trying to read or write protected memory" ?
The thing is that I'm trying to create an application that detects if a table changes. Is this the right way to do this anyway or are there better solutions?
I have created a custom resolver in VB .net (VS2005). The resolver works ( Both Publisher and Subscriber are SQL 2005 ), but I need to be able to debug the code within the resolver. How do I do this? I have tried a number of things without success.
version SQL Server 2005 SP2 table in SQL Server 2000 (80) compatibility level publication in SQL Server 2000 compatibility level - Distributor : SQL Server 2005 SP2 - Subscriber : SQL Server 2000 SP4 + hotfixes (version 8.00.2187)
There is only one article in our publication (a simple table with a GUID and a nvarchar(50) columns), and we have left the default resolver.
1 - The first synchronization of the subscription is successfully completed, and it is the same for the different updates/inserts/deletes or conflicts.
2 - Then we change the Resolver of our article by our own COM-Based Custom Resolver (developped in C# 2.0). This resolver only change the default behaviour: the subscriber always win (this is for a test, in the future we will have a complex business logic). All the synchronizations works fine and do what we want in the conflicts.
3 - We rollback the resolver to the default one... and here is the problem! The synchonizations stop to work correctly. For all of them we've got the same error:
It is no more possible to synchronize this subscription... Any remark will be helpfull cause we did not find anything on the net concerning this error.
I am doing a work were i have to syncronize data between a Publiser (PC, SQL SERVER 2005), and a subscriber (Pocket PC, SQL CE MOBILE). I studied lots of articles and i managed to put the syncronization to work, the problem is in conflict resolution!
The subscriber can΄t insert or delet, only update!!
For exmple: I have a table that contais the quantity of a product X, for example 100 units, this goes to Pocket, but later arrive move 100 units that are increased in the PC, so we get 200 in the PC, (but 100 in Pocket), no problem if i syncronize now (Pocket will have 200 too), but if remove in Pocket for example 50 units, i've changed the same column in both Publisher and Subscriber database, if i syncronize now, i'll have a conflict, the final result should be 150 of product X in both databases (100 + 100 - 50), but the Publisher wins the conflict and the final result is 200!
I never worked with stored procedures and in microsoft theres and article called How to: Implement a Stored Procedure-Based Custom Conflict Resolver for a Merge Article (Replication Transact-SQL Programming), but they dont explain it very well and i dont know how to do my own stored procedure and implement it to the merge article.
in my own stored procedure i'll have to do some calculations to get the result i want, maybe using some table for the additions and subtractions. (Does the com based Addition resolver do this for me???)
Maybe you have experienced some problem like this, and could help me!
How should i do the stored procedure?
Oh, i tried to use de addiction resolver and the average resolver of com based but nothing happed, dont know why, i read some stuff and i think the addition could solve my problem, but it doesn΄t work, i read above what you said and installed service pack 1 for sql 2005, but i instaled and nothing happened! When i change to the resolver that the subscriver wins, it works, why addition dont work?
I have gone through BOL and various online resources including this one and I can't find any examples on how to use custom conflict resolvers to generate a result row which is a combination of the rows to be merged.
BOL says it can be done, but suitable examples are missing. I have found various posts requesting examples from up to a year ago, but can see no replies with relevant information
In particular I would like to see examples of
1) A stored procedure based custom conflict resolver
I'm having this problem for a while now and can't find any solid answer on the net for it.
I have 2 server in diffrent location ( +- 1200k's) away from eachother. When the msmerge agent run it return the following error and return the status as successfull with the following error information:
(The colum information specified for the MS SQL Server maximum conflict resolver) Resolver is either missing or incorrect. I've change every single article to "Latest chagne wins". Any suggestion. I happend when the power failed and the server got restarted.
I am creating a custom transformation component, and a custom user interface for that component.
In my custom UI, I want to show the custom properties, and allow users to edit these properties similar to how the advanced editor shows the properties.
I know in my UI I need to create a "Property Grid". In the properties of this grid, I can select the object I want to display data for, however, the only objects that appear are the objects that I have already created within this UI, and not the actual component object with the custom properties.
How do I go about getting the properties for my transformation component listed in this property grid?
What I want to accomplish is that at design time the designer can enter a value for some custom property on my custom task and that this value is accessed at executing time.
I am writing a custom task that has some custom properties. I would like to parameterize these properties i.e. read from a varaible, so I can change these variables from a config file during runtime.
I read the documentation and it says if we set the ExpressionType to CPET_NOTIFY, it should work, but it does not seem to work. Not sure if I am missing anything. Can someone please help me?
In the Editor of my custom task, under custom properties section, I expected a button with 3 dots, to click & pop-up so we can specify the expression or at least so it evaluates the variables if we give @[User::VaraibleName]
Does anybody know if there are any conflicts using an XP computer as server and running SQL 7.0 on it?
I have a laptop using Windows XP, that I also have installed SQL 7.0 on (desktop version). I use it both as a client and as a server. As a client I am connecting to the NT server and it is working perfectly. When I try to run my SQL developed software against the local server though, I get a message saying "-2147217900 - Duplicate record or Record is in use. The request for procedure "TABLE NAME" failed because "TABLE NAME" is a table object"
why do i get collation conflict when i used temp table ??Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.i solved it by using COLLATE Latin1_General_CI_AS (the column name)will i have collation conflicts again when i put my web app on a web hosting company??
I have 2 tables Users and DVDTestResults these tables have a relation over UserID Users.UserID DVDTestResults.UserName
both char
But when I try to insert in DVDTestResults I am having an error:
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_DVDTestResults_Users'. The conflict occurred in database 'Test', table 'Users', column 'UserID'. The statement has been terminated.
INSERT statement conflicted with TABLE FOREIGN KEY constraint 'FK_ChecklistCases_ChecklistFGroups'. The conflict occurred in database 'Test', table 'ChecklistFGroups'. The statement has been terminated.
but it seems to be no error can you help me please I can send you the related part of database
I am doing this in SQL Query analyzer:select dbo.GetTimedifference(CAST('5:30 PM' AS DATETIME),CAST('12:00 PM' AS DATETIME))it will give me (- 05:30) which is correct if i am talking about 12:00 PM midnight, what if I ment 12:00 PM in the noon, I mean, 11:00 AM, then 12:00 PM, it should give me, (5:30)since 5:30 Pm is 5:30 hours pass 12:00 PM noon, how can I solve that ?thanks a lot.
I'm using merge replication between 10 SQL server 7.0 SP2 machines. One central server is the publisher and 9 subscribers. Ive setup an alert to get a message in case of conflicts. I defined it to trigger everytime the performance counter conflicts/sec rises above 0.
After some experimenting this seems now to work reliable, but there is still one point which bothers me. All conflicts are kept in the conflict history and everytime I get a message through the alert the number of copnflicts stated in the message increases by one. Also if I open view replication conflicts in EM all conflicts can still be viewed even those I manually resolved. I can't even find a way to seen which conflicts are new ones and which have been resolved already. Does anybody know a way how to reset this numbers without going through all the conflict tables.
I have a database thats got sql as the engine and access 2000 for the client side. and every time I edit a record this "Write Conflict" comes up. I dont know why its doing that but Idont want that happening whent the database goes live and my users start editing records. what do I, apparently its a Replication Conflict
I have a db server which was installed with Collation 'SQL_Latin_General_CP1_CS_AS' and now I have to replace this server with a new server and I want to install this server with Collation 'SQL_Latin_General_CP1_CI_AS'.
I am using Linked Servers to collect some data from my Sybase database which has "Code Page 850 (Multilingual) character set,us_english,Binary ordering, for use with Code Page 850 (cp850)."
But with new SQL server(case-insensitive settings), I am unable to run a select query (joining a local server and sybase server) and I get an error message "cannot resolve collation conflict for equal to operation"
I have tried changing property of linked server by specifying Remote server collation to true and Collation Name as 'SQL_Latin_General_CP1_CS_AS' as well as 'SQL_Latin_General_CP850_Bin' but I do get the same error message.
Could any of you please help me in this regard ?
Thanks in advance.
Wilson
Edit: Sorted out. Somehow it is working now after specifying Remote server collation to true and Collation Name as 'SQL_Latin_General_CP1_CS_AS'