Weird Results Post Merge Agent Run (Automatic Identity Range Management)

Dec 1, 2005

I have implemented replication between 2 servers (SERVER1 AND SERVER2) and for test purposes i just have 1 table(Table1) in the publisher.

View 1 Replies


ADVERTISEMENT

Merge Replication - Setting Identity Range Management.

Feb 2, 2007

Hi All;

I am trying to set up Merge Replication on a database and want to set the IdentityRange Management to Auto for all my tables which use a Identity column.

In the wizard, on Article Properties Page, I can do this by selecting a Table, and going for its properties, but this is a tedious task as I have ~300 tables to set this property on.

Is there another way or a global location where I can set the property to true and even mention the ranges and the threshold, so that I dont have to pick each table and set it individually.

I am also aware of the fact that I can Generate a Script and modify it and run that, but I was looking for some way to do this in the wizard.

Thanks!

View 1 Replies View Related

Identity Range Management

Dec 21, 2006

Hello all,

I am just beginning to get into replication and have a couple questions for the experts.

When I set up replication (transactional with queued updates), the default identity range was set to 10,000 for the publisher and 1,000 for the subscriber. I understand that if I try to insert 1,100 records at the subscriber, I will get an error saying that the identity range has been exhausted and I need to run sp_adjustpublisheridentityrange on the publisher and the Distribution Agent for the subscriber.

My questions are:


Why wouldn€™t someone increase the identity range to a very large number, just in case something happens and the publisher/subscriber link is broken for an extended period of time? What are the ramifications to a larger identity range?
Since identity range management is done by the distributor, what happens if the distributor goes down? Do the publisher and subscribers receive errors when they fill their current ranges?
Thanks,

Jarret

View 1 Replies View Related

Merge Replication Identity Range Error

Jan 8, 2008

Hi all i have setup merge replication with one publisher and 3 subscribers



The replication worked fine for about 2 months then i recieved the following error on all my subscriptions



The Publisher failed to allocate a new set of identity ranges for the subscription.
This can occur when a Publisher or a republishing Subscriber has run out of identity
ranges to allocate to its own Subscribers or when an identity column data type does
not support an additional identity range allocation. If a republishing Subscriber has
run out of identity ranges, synchronize the republishing Subscriber to obtain more
identity ranges before restarting the synchronization. If a Publisher runs out of identit
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199417)
Get help: http://help/MSSQL_REPL-2147199417


I have updated my sql server to service pack 2

The publisher is sql Standard edition and the subscribers are Express edition



Any help would be great

Thanx

View 3 Replies View Related

Replication :: Auto Identity Range Management?

Jun 14, 2010

I'm having a problem with merge replication.  My publisher and subscriber are SQL 2008 SP1, and my distributor is SQL 2008 R2.  Currently, there is no access to the subscriber data aside from the replication agents, so there are no data changes going on there, data is only being modified on the Publisher.  My plan was to get everything setup and do some internal testing before releasing the subscriber for use.

View 4 Replies View Related

Can I Set A Default Range For The Identity Values For Merge Replication?

May 8, 2006

Hello,

We have a couple of tables that can have quite a bit of data each day prior to replication. Can we increase the default values for a table for each subscription? For example we have a table called table1 and on the sqlexpress client they could enter in 10000 rows a day, on table2 it's just 100 rows a day. How can we increase the values to where we do not get the error for table1 stating that the insert failed because it conflicted with the identity range check constraint. Thanks in advance.

View 1 Replies View Related

Finding Valid Identity Range On Merge Subscriber

Nov 22, 2006

I am using merge replication with automatic identity range management

I want to be able to give a disconnected subscriber a warning message if a certain percentage of the allocated subscriber identity range has been used
- so that they can make sure they reconnect soon to obtain a new identity range

I can get the current identity value OK, but I can't find a good way of finding the current permitted primary and secondary ranges

The information is available in the check constraint, but I don't really want to have to parse this!

CONSTRAINT [repl_identity_range_0DF907AC_40CF_4849_9BD0_2173C90A3805] CHECK NOT FOR REPLICATION (([ContactID]>(10000040000.)
AND [ContactID]<=(10000050000.) OR [ContactID]>(10000050000.) AND [ContactID]<=(10000060000.)))

I can't find any system view which will provide this information

Is there a recommended way of doing this?

Thanks

aero1

View 3 Replies View Related

Identity Range Managed By Replication Is Full And Must Be Updated By A Replication Agent. Error Message Makes NO SENSE.

Mar 6, 2007

Hello,I'm getting the following error message when I try add a row using aStored Procedure."The identity range managed by replication is full and must be updatedby a replication agent".I read up on the subject and have tried the following solutionsaccording to MSDN without any luck.(http://support.Microsoft.com/kb/304706 )sp_adjustpublisheridentityrange (http://msdn2.microsoft.com/en-us/library/aa239401(SQL.80).aspx ) has no effectFor Testing:I've reloaded everything from scratch, created the pulications from byrunning the sql scripts generated,created replication snapshots andstarted the agents.I've checked the current Identity values in the Agent Table:DBCC CHECKIDENT ('Agent', NORESEED)Checking identity information: current identity value '18606', currentcolumn value '18606'.I check the Table to make sure there will be no conflicts with theprimary key:SELECT AgentID FROM Agent ORDER BY AgentID DESC18603 is the largest AgentID in the table.Using the Table Article Properties in the Publications PropertiesDialog, I can see values of:Range Size at Publisher: 100,000Range Size at Subscribers: 100New range @ percentage: 80In my mind this means that the Publisher will assign a new range whenthe Current Indentity value goes over 80,000?The Identity range for this table cannot be exhausted! I'm not surewhat to try next.Please! any insight will be of great help!Regards,Bm

View 1 Replies View Related

Merge Repliction - Run Stored Procedure When Merge Agent Starts

Jul 23, 2005

I have database on SQL Server 2000 set up with a merge publication.This publication is configured with a number of dynamic filters toreduce the amount of data sent to each client. Each client has ananonymous pull subscription. The merge process can be triggered by thewindows sync manager and my application.To improve performance I have created some helper tables to hold themapping between user login and primary keys of selected entities.For the replicated data to be correct the contents of the helper tablesneeds to be up to date.I need to fire off a stored procedure on the publisher beforereplication starts to verify that this data is up to date. I can notsee any documented way of doing this however I have been experimentingwith some unorthodox systems.Firstly has anyone any ideas?I have been considering adding a trigger to some of the tables used bythe Microsoft replication code - yes I know this is very nasty.My problems arise because executing this stored procedure will causesome data to be updated. In updating data we could create a newgeneration in the database. I must therefore run my stored procedurebefore any the Microsoft code makes any generation checks / updates.Anyone done anything similar, Anyone have any better ideas?Any comments would be gratefully received.

View 1 Replies View Related

Merge Replication - Weird Stuff

May 21, 2007

I'm implementing merge replication between SQL CE and sql server 2005 SP2. Here is the problem I'm facing



I have dynamic filters on some tables like

Select * from table1 inner join table2

ON table1.field1 = table2.field3

and table2.flag = true



When table2 flag turns true then all the matching records in table1 should be returned to the subscriber.



But that is not happening. The filter does not return any records to the subscriber even though i see records when i run the query on the server. My take on this is the publisher thinks there is no changes on table1 so there is nothing to update. So to fix that i run dummy updates like

update table1

set [name] = [name]

where table1.field1 in

(Select field2 from table2 where flag=true)



This updates the records and the publisher updates the subscriber the first time. When i set the flag to false, it is supposed to remove the data from the subscriber but i get this error.




The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800





I have no idea whats going on. Any clues, anyone? Thanks for your help.





Ramesh

View 13 Replies View Related

Merge Replication Weird Scenario?

Dec 15, 2005

 
On the national Server:           SQL 2005 Enterprise
On the mobile clients:             SQL 2005 Workgroup.
 
 
I was asked to find a solution to such scenario
 
2 mobile subscriber S1 and S2 to the same simple merge publication P1 on server N
 
Day 1,

S1 and S2 both synch up with N and both go off to do fieldwork
Day3,


S1 and S2 both synch up with N.

S1 goes back to work

S2  shutdown the laptop and goes on 2-week vacation.
2 Weeks late



S1 Synch up wit the server and goes off to do fieldwork.

S2 meets S1 in the field. Their workfield is in the North Pole.

S2 has the laptop with data 2-weeks old but no longer can have access to the master publisher N to synch the replica and get latest changes.

S2 will have to sync with S1 since S1 database is fresh. The challenge is to have S2 and S1 replica identical
 
The Questions:


Is it possible for S2 to sync with S1? 

if yes, How to go about it€¦ we need S1 and S2 to have identical replica on their machines?



Now that S1 and S2 are have identical databases and are both doing their fieldwork in the northpole. Can they both sync back with the national publisher N when they have access?
Keep in mind that S2 got its data updated from the replica on S1?
 
Thank you!
 
 
 
 

View 3 Replies View Related

Add New Record - Weird Results

Jul 20, 2005

I have written a generic script in asp to add records to a table. Thescript works fine with one table but in the other tables it updatesthe first record in the table with the values for the new record andadds a new record with all null values?!? Here is the script:adOpenKeyset=1adLockOptimistic=3Set cnnFormToDB = Server.CreateObject("ADODB.Recordset")'INSERT******************************************* ******************'Open connection to sub-tableif action = "insert" thencnnFormToDB.Open "SELECT top 1 * FROM " &subtable,"DSN=Barrheadsql;UID=barrhead;PWD=ty93eta",adOpenKeyset,adLockOptimisticcnnFormToDB.AddNewelsecnnFormToDB.Open "SELECT top 1 * FROM " & subtable & " WHERE ID = " &ID, "DSN=Barrheadsql;UID=barrhead;PWD=ty93eta", adOpenKeyset,adLockOptimisticEnd Ifif not cnnFormToDB.eof thencnnFormToDB.MoveFirstend if'DELETE******************************************* ********************if action = "delete" thencnnFormToDB.DeletecnnFormToDB.Closeelse'Build 2nd SQL StringFor i=0 To Ubound(aFields)cnnFormToDB(aFields(i)) = aValues(i)Next'Insert record into sub-tablecnnFormToDB.UpdateThe even weirder thing is I know that values in aFields and aValuesare OK because this test script I wrote for one of the tables worksjust fine:adOpenKeyset=1adLockOptimistic=3Set cnnFormToDB = Server.CreateObject("ADODB.Recordset")cnnFormToDB.Open "SELECT top 1 * FROM FlightsDirect","DSN=Barrheadsql;UID=barrhead;PWD=ty93eta", adOpenKeyset,adLockOptimisticcnnFormToDB.AddNewcnnFormToDB("fkCity") = 198cnnFormToDB("fkDepartureAirport") = 159cnnFormToDB("ValidFrom") = "17/09/2003"cnnFormToDB("ValidTo") = "15/10/2003"cnnFormToDB("fkType") = 1cnnFormToDB("ReturnFlight") = 1cnnFormToDB("fkReturnAirport") = 184cnnFormToDB("Price") = yyyyyycnnFormToDB("fkATOL") = 5346cnnFormToDB.UpdateAny suggestions appreciatedThanksAlison

View 1 Replies View Related

Weird INSERT INTO SELECT Results

May 20, 2006

Hi all,

I am having a weird problem occur when trying to insert missing records based on an INSERT INTO...SELECT statement.

Basically, I am populating a temporary table with data, then inserting into a main table those records from the temporary table that aren't in the main table. In addition, I am updating those records that are in the main table.

When I call the following SQL, all of the records from the temporary table are inserted even though those records already exist. Bizzarrely the update statement works perfectly.

INSERT INTO
AffiliateCategories (Identifier, AffiliateID, NetworkID, AffiliateCategoryName, NetworkCategoryName)
SELECT
Identifier,
AffiliateID,
1,
AffiliateCategoryName,
NetworkCategoryName
FROM
#TempTradeDoublerCategories
WHERE
#TempTradeDoublerCategories.AffiliateCategoryName NOT IN
(
SELECT
AffiliateCategoryName
FROM
AffiliateCategories
)


I am not sure why it is doing this and it's driving me crazy. If anyone has any ideas why this is happening, or knows of a better way to accomplish this then please let me know.

Are there some issues with string comparisons going on here?

The table that populates the temp table is defined as:

CREATE TABLE [dbo].[Staging_TradeDoubler_Categories](
    [id] [int] NULL,
    [name] [nvarchar](255) COLLATE Latin1_General_CI_AS NULL,
    [merchantName] [nvarchar](255) COLLATE Latin1_General_CI_AS NULL,
    [TDCategories_Id] [int] NULL,
    [AffiliateID] [int] NULL
) ON [PRIMARY]


Full code listing:

IF OBJECT_ID('tempdb..#TempTradeDoublerCategories') IS NOT NULL
DROP TABLE #TempTradeDoublerCategories

CREATE TABLE #TempTradeDoublerCategories
(
Identifier INT,
AffiliateID INT,
AffiliateCategoryName VARCHAR(255),
NetworkCategoryName VARCHAR(255)
)



INSERT INTO
#TempTradeDoublerCategories (AffiliateCategoryName)
SELECT DISTINCT
CAST(merchantName AS VARCHAR(255)) AS MerchantName
FROM
Staging_TradeDoubler_Categories
ORDER BY
MerchantName



UPDATE
#TempTradeDoublerCategories
SET
#TempTradeDoublerCategories.Identifier = Staging_TradeDoubler_Categories.id,
#TempTradeDoublerCategories.AffiliateID = Staging_TradeDoubler_Categories.AffiliateID,
#TempTradeDoublerCategories.NetworkCategoryName = Staging_TradeDoubler_Categories.[name]
FROM
Staging_TradeDoubler_Categories
WHERE
Staging_TradeDoubler_Categories.merchantName = #TempTradeDoublerCategories.AffiliateCategoryName



UPDATE
#TempTradeDoublerCategories
SET
#TempTradeDoublerCategories.AffiliateID = Staging_TradeDoubler_Affiliates.AffiliateID
FROM
Staging_TradeDoubler_Affiliates
WHERE
#TempTradeDoublerCategories.AffiliateID = Staging_TradeDoubler_Affiliates.TradeDoublerAffiliateID

Print 'Inserting records'

INSERT INTO
AffiliateCategories (Identifier, AffiliateID, NetworkID, AffiliateCategoryName, NetworkCategoryName)
SELECT
Identifier,
AffiliateID,
1,
AffiliateCategoryName,
NetworkCategoryName
FROM
#TempTradeDoublerCategories
WHERE
#TempTradeDoublerCategories.AffiliateCategoryName NOT IN
(
SELECT
AffiliateCategoryName
FROM
AffiliateCategories
)

Print 'Updating records'

UPDATE
AffiliateCategories
SET
AffiliateCategories.AffiliateCategoryName = #TempTradeDoublerCategories.AffiliateCategoryName,
AffiliateCategories.NetworkCategoryName = #TempTradeDoublerCategories.NetworkCategoryName,
DateModified = GETDATE()
FROM
#TempTradeDoublerCategories
WHERE
#TempTradeDoublerCategories.AffiliateCategoryName IN
(
SELECT
AffiliateCategories.AffiliateCategoryName
FROM
AffiliateCategories
)



PRINT 'Dropping table'


IF OBJECT_ID('tempdb..#TempTradeDoublerCategories') IS NOT NULL
DROP TABLE #TempTradeDoublerCategories

View 1 Replies View Related

Synchronous Merge Replication(Automatic)

Aug 30, 2006

hi there

I am using SQL SERVER 2005.

I am creating a Merge replication(between two databses), its working well, but i need to goto the Local publications & right click there & select the "View Synchronization Status" & then start the Agent manually to Synchronous the databases.

Now I want the Two databses should be replication (Merge) automatically without going to any menu.

I mean the Synchronization takes place when any of the Databases changes, automatically, without touching anything.

For Example:

If one record is inserted in a table(on commit) of Database ONE, it should be Reflected to the other table of the database TWO.

Any Idea, or Link or solution???

Gurpreet S. Gill



View 4 Replies View Related

Merge Replication Throwing Very Weird Error Messages

Mar 2, 2007

I've been setting up subscriptions to a merge publication for the past 3 days. All of a sudden, I'm getting a pile of very strange errors. Replication is configured. I have 16 subscribers to an existing publication configured and synchronizing changes without any issues. The script that I'm using to create all of the subscriptions is as follows:

use [PIC]

exec sp_addmergesubscription @publication = N'PIC', @subscriber = N'machinenameSQLEXPRESS',

@subscriber_db = N'MyDatabase', @subscription_type = N'Push', @sync_type = N'Automatic',

@subscriber_type = N'Global', @subscription_priority = 75, @description = N'', @use_interactive_resolver = N'False'

exec sp_addmergepushsubscription_agent @publication = N'PIC', @subscriber = N'machinenameSQLEXPRESS',

@subscriber_db = N'MyDatabase', @job_login = null, @job_password = null, @subscriber_security_mode = 1,

@publisher_security_mode = 1, @frequency_type = 64, @frequency_interval = 0, @frequency_relative_interval = 0,

@frequency_recurrence_factor = 0, @frequency_subday = 0, @frequency_subday_interval = 0, @active_start_time_of_day = 0,

@active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0

GO

The last one that I added #17, gives the following errors after successfully creating the subscription.

Command attempted:


{call sys.sp_MSmergesubscribedb ('true', 0) }

Error messages:


The merge process could not initialize the subscription. Ensure that the subscription registration exists at the publisher, and reregister the subscription if necessary. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201011)
Get help: http://help/MSSQL_REPL-2147201011

RegCreateKeyEx() returned error 5, 'Access is denied.' (Source: MSSQLServer, Error number: 22002)
Get help: http://help/22002

Could not add article resolver 'Microsoft SQL Server Additive Conflict Resolver' information to the registry (Source: MSSQLServer, Error number: 21713)
Get help: http://help/21713

Could not register article resolver: 'Microsoft SQL Server Additive Conflict Resolver'. (Source: MSSQLServer, Error number: 21715)
Get help: http://help/21715

The system tables for merge replication could not be created successfully. (Source: MSSQLServer, Error number: 20008)
Get help: http://help/20008

I've tried to manually create it using the GUI and get an even stranger error message as follows:

TITLE: New Subscription Wizard
------------------------------

Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

Replication components are not installed on this server. Run SQL Server Setup again and select the option to install replication. (Microsoft SQL Server, Error: 21028)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=21028&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


I very obviously have replication installed by virtue of the fact that I have a publication and 16 subscriptions that are currently synchronizing. Any ideas?

View 3 Replies View Related

Weird Conflicts - Merge Replication 2005 -&&> 2000

Aug 3, 2006

Publisher is 2005 x64, subscribers SS2000 (SP3) and SS2005 x64. Pull agents, no filters on subscriptions. We are seeing many seemingly random conflicts on between SS2000 subscriber and publisher. It happens on several different tables.

One table is never editted, only inserts happening everywhere and deletes happening on the SS2000 subscriber. Deletes will sometimes generate conflict. Reason is '"he row was deleted at 'CTS11.CTS' but could not be deleted at 'cts4a.cts'. Unable to synchronize the row because the row was updated by a different process outside of replication." CTS11 is SS2000 subscriber, CTS4A is publisher.

Probably unrelated bug but when looking at conflicts on this same table in SS2005 conflict viewer, get error "ID is neither a DataColumn nor a DataRelation for table summary (System.dATA)" and then "Column ID does not belong to table summary (System.Data)". ID column is rowguid, only unusual thing about table is that it has varchar(8000) field plus some other fields.


Other tables generate conflicts with this reason "The row was updated at 'CTS11.CTS' but could not be updated at 'cts4a.cts'. The merge process was unable to synchronize the row." I enabled verbose logging in the merge agent but the log file didn't contain any further explanation.

This same topology and schema worked fine when all publishers and subscribers were SS2000.

Any insight into how to fix this would be appreciated.





View 9 Replies View Related

Modify Next Identity Range

Feb 6, 2007

i have a publisher and a few suscribers running with sql 2003

I use automatic range handling to manage some identity columns in some tables

How can I to modify manually the value of the next range that the publisher will assign to the next suscriber that need a range?

View 3 Replies View Related

Insert Out Of Range ID Value Into Identity Column?

Feb 7, 2007

I need to import some data into a table that is in a merge bi-directional publication. The table has an identity column that is being "auto managed". The ID numbers I need to import are not within any of the assigned "ranges". They are less than any of the current ranges.

Turning ident_insert on does not work because of the check constraints error. The merge replication triggers validate the ID range as well.



Edit: using SQL 2005 standard publisher and subsciber. Publication is 2005.

View 7 Replies View Related

SQL 2012 :: Table Partitioning - Switch Out / Merge Range

Mar 6, 2014

If the partitioning MERGE command attempts to drop historic data at the wrong boundary point then data movement between file groups may be necessary before or during the next index rebuild. The script below creates 2 test tables, one using a range right function and the other using range left. The partitioning key is a number between 0 - 59, an empty partition is maintained at the start and end of ranges, 4 partitions contain data in the ranges between 0-14, 15-29, 30-44, 45-59. Data in the lowest range (0 - 14) is switched out and a merge command is run, edit the script to try the different merge boundaries, edit the variables at the start to suit runtime environment 'Data Drive' & 'Log Drive' paths.Variables are redeclared but commented out at the start of code blocks to allow stepping through if desired.

--=================================================================================
-- PartitionLabSetup_20140330.sql - TAKES ABOUT 1 MINUTE TO EXECUTE
-- Creates a test database (workspace)
-- Adds file groups and files
-- Creates partition functions and schema's
-- Creates and populates 2 partitioned tables (PartitionedRight & PartitionedLeft)

[Code] ....

The T-SQL code below illustrates one of the problems caused by MERGE at the wrong boundary point. File Group 3 of the Range Right table is empty according to the data space views, it cannot be dropped though. File Group 2 contains data according to the views but you are allowed to drop it's file.

USE workspace;
DROP TABLE dbo.PartitionedRightOut;

USE master;
ALTER DATABASE workspace
REMOVE FILE PartitionedRight_f3 ;
--Msg 5042, Level 16, State 1, Line 2
--The file 'PartitionedRight_f3 ' cannot be removed because it is not empty.

ALTER DATABASE workspace
REMOVE FILE PartitionedRight_f2 ;

-- Works surprisingly although contains data according to system views.

If the wrong boundary point is used then the system 'Data Space' views show where the data should be (FG2), not where it actually still is (FG3). You can't tell if data movement between file groups is pending and the file group files are not protected from deletion by the OS.

I'm not sure this is worth raising a connect item for but it would be useful knowing where data physically resided after a MERGE RANGE and before an INDEX REBUILD, the data space views reflect the logical rather than the physical location if a data movement is pending.

View 0 Replies View Related

Merge Agent Log

Dec 14, 2000

Does anyone know why i can't see all sessions of past synchronisations
in EM ->Agents->MergeAgents->properties (Filter All Sessions)
I only see the last 2 or 3 and all older ones are deletet.
Are there better possibilities to see what was going on?
Thanx in advance

Gert

View 1 Replies View Related

Cannot Set The ProfileName On A Merge Agent

Jun 28, 2006

Hi,

I am trying to create a new merge subscription using RMO on Sql 2005, but I want the new agent to use a non-default profile.

I can set the ProfileName on the agent but it seems to have no affect. I was wondering, do I have the wrong Profile name?

This is the code I'm using



subscription = new MergeSubscription();

subscription.ConnectionContext = conn;

subscription.SubscriberName = server;

subscription.SubscriberSecurity.SqlStandardLogin = sqlUserName;

subscription.SubscriberSecurity.SqlStandardPassword = sqlPassword;

subscription.SubscriberSecurity.WindowsAuthentication = useWindowsAuth;

subscription.PublicationName = publication.Name;

subscription.DatabaseName = publication.DatabaseName;

subscription.SubscriptionDBName = database;

subscription.SyncType = SubscriptionSyncType.Automatic;

subscription.SubscriberType = MergeSubscriberType.Global;

subscription.Priority = 75;

subscription.UseInteractiveResolver = false;







if(hostNameOverride != null && hostNameOverride.Length > 0)

subscription.HostName = hostNameOverride;

subscription.SynchronizationAgentProcessSecurity.Login = agentUserName;

subscription.SynchronizationAgentProcessSecurity.Password = agentPassword;

// Create the push subscription.

subscription.Create();



if (subscription.SynchronizationAgent != null)

subscription.SynchronizationAgent.ProfileName = "High Volume Server-to-Server Profile";



Can anyone tell me what I've done wrong??

Regards

Graham

View 6 Replies View Related

Merge Agent Error

Apr 27, 2006

Hi

We are using HTTPS merge replication.

One of my subscribers is getting this error:

Error messages:

The Merge Agent failed after detecting that retention-based metadata cleanup has deleted metadata at the Publisher for changes not yet sent to the Subscriber. You must reinitialize the subscription (without upload). (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199402)

 

This is a bit surprising - it has been working fine - and also there were no changes at the publisher (it only has one article in this publication - a stored proc)

Why would this have happened ? The retention period is 45 days and they synchronised successfully only a few days prior.

 

thanks

View 19 Replies View Related

Transact SQL :: Query Distinct Results Based On Date Range

May 21, 2015

I have a data structure like this

UID , Name, amount, start date                               End Date
     1      A         10         2015-05-01 00:00:00             2015-05-01 23:59:59
     2      A         10         2015-05-02 00:00:00             2015-05-02 23:59:59
     3      A         10         2015-05-03 00:00:00             2015-05-03 23:59:59
     4      A         10         2015-05-04 00:00:00             2015-05-04 23:59:59
      5      B         10         2015-05-05 00:00:00             2015-05-05 23:59:59

[code]...

View 5 Replies View Related

SQL Server 2008 :: Replicating Merge Range And File Drops For Partitioned Table?

Jul 28, 2015

I have few tables, which are replicated and partitioned. They also have archival process. I want to avoid having to run that same process on the subscriber.

Replication of partition switching is easy. However I am not sure how to replicate merge range and empty filegroup/file drops.

There the following article options:

Copy file group associations
Copy table partitioning schemes
Copy index partitioning schemes

I am not sure if these are enough to implement the replication of merge range and empty filegroup/file drops.

I could not find and option to copy partition functions.

View 0 Replies View Related

SQL Server 7 Agent Log Management

Feb 23, 2001

SS7 has several Agent logs: ( .errorlog, .1, .2, .3, .4, .5, .6, .7, .8, and .9).

The current log is the .errorlog.

Questions about the management of Sql Agent Logs.

1. Can I safely delete the logs .1 through .9 (one of these logs is taking up megabytes of space).

2. Any way I can force a log re-initialization (similar to the server log initialization using proc sp_cycle_errorlog)

BOL says I can rename the log when SQL Agent is down, but we run SQL Agent 7x24.

Thanks!!

View 1 Replies View Related

Merge Agent Login Problem

Jun 23, 2006

I have a push merge replication up and working in development SQL Server 2005 (publisher) and SQL Express (subscriber). Because the upgrade from 2000 to 2005 for our production servers has been delayed for who knows how long, I am working to set the same replication up with 2000 and MSDE.

The merge agent is failing in 2000 with the error:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. (Source: MSSQLServer, Error number: 18452)


The 2005 merge agent runs fine. I think it is because the 2005 subscription wizard allowed me to set the 'Run as: SQL Agent Service Account' option, instead of a windows authentication uid. There is no opportunity to set this in the 2000 subscription wizard nor on the merge agen job step itself. I didn't take a screen dump, but am confident that I used the SECURITYMODE=SQL parameter on the MSDE client install.

Any help on whether I'm correct on what the problem is and what to change to get the 2000 merge to log in with the SQL agent service account would be great. Thanks.

View 4 Replies View Related

Identity And Merge Replication

Jan 31, 1999

Dear all,

How does an identity is affected by merge replication? Can sql control it so that there will be no replication conflict?

Here's the scenario, I have several tables with an identity column. the database resides in a server in the head office, there are several remote sites and remote users which will be running sql 7 desktop edition. Each remote will download only the data subset he is allowed to. Each site will be allowed add new rows on several table. Then they will update the head office server through replication.


Thanks

Reden

View 1 Replies View Related

Transact SQL :: How To Hard Code Mention Date Range In SP To Get Expected Results

Oct 7, 2015

how to hard code mention date range in my SP to get expected results in my query 01/01/2012 to 12/31/2012

DECLARE @ACCOUNT AS INT
DECLARE @POSTING_DATE AS DATETIME
DECLARE @FIRST_POSTING_DATE AS DATETIME
SET @POSTING_DATE = {?POSTING_DATE}
SET @ACCOUNT = {?ACCOUNT}

[code]...

View 3 Replies View Related

How To Restart A Stopped Merge Agent Automatically

May 7, 2006

Hi, I have setup a replication between two servers. And sometimes due to network connection problem, I get error message like :

The subscription to publication 'pub_1' is invalid.

After 10 retries, if connection cannot be made successfully, the Merge Agent will stop running.

How can I start the Merger Agent automatically after it has been stopped?

View 5 Replies View Related

Merge Publication - Snapshot Agent Error - Help

Apr 19, 2007

Hi all,



I have a merge publisher with Snapshot agent for that scheduled to run everyday morning, This was runnning till yesterday. But it is not running today and giving the below error.



Can anyone help me out to solve this error? This is occuring in production environment, i really need a solution as fast as possible.


Error messages:
· Message: Failed to read column data
Stack: at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint, String strWhereClause)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strDataFile)
at Microsoft.SqlServer.Replication.Snapshot.MergeContentsBcpOutWorkItem.DoWork(MergeSnapshotProvider snapshotProvider, IBcpOutProvider bcpOutProvider)
at Microsoft.SqlServer.Replication.Snapshot.MergeContentsBcpOutThreadProvider.DoWork(WorkItem workItem)
at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
at Microsoft.SqlServer.Replication.WorkerThread.AgentThreadProc()
at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
· Message: Shared Memory Provider: No process is on the other end of the pipe.
Stack: (Source: MSSQLServer, Error number: 233)
Get help: http://help/233
· Message: Communication link failure
Stack: (Source: MSSQLServer, Error number: 233)
Get help: http://help/233
· Message: Shared Memory Provider: No process is on the other end of the pipe.
Stack: (Source: MSSQLServer, Error number: 233)
Get help: http://help/233
Message: Communication link failure
Stack: (Source: MSSQLServer, Error number: 233)



Thanks,

Thams

View 16 Replies View Related

Identity Seed Gone Bad In Merge Replication

Aug 8, 2007

Sever: sql 2000
Replication: Merge

Issue:
I am having an issue with my audit table, This table is filled by Triggers on various tables through the database. All triggers are defied with "not for replication"

I have allocated 500k ranges, with 80% threshold to the publisher and subscriber databases for this table. The table only holds 225,000 records.

From time to time I get the following error "The identity range managed by replication is full and must be updated by a replication agent. The INSERT conflict occurred in database 'PublicationName', table 'AuditHistory', column 'AuditID'. Sp_adjustpublisheridentityrange can be called to get a new identity range."

When I looked into the issue yesterday I noticed that the identity range being used by replication was 334300001 -> 334799999, however the maximum value in the table was 334300096, meaning that only 95 records were inserted, which means it is no where near the 80% threshold.

Somehow the identity seed on the AuditHistory table had been changed to 334800104, which is outside the allowable range.

My question is what could cause the identity seed to get set to such a high number??

any thoughts would be great!

View 2 Replies View Related

Merge Replication Identity Ranges

Apr 5, 2008

I have a database table with a simple identity column. As a starting point... when I run the following queries... this is what I get:

SELECT Max(AliasID) FROM Account_Managers
1300006

DBCC CHECKIDENT ('Account_Managers')
Checking identity information: current identity value '1300006', current column value '1300006'.


Now... I set up merge replication, with the plan of allowing SQL Server to manage my identity ranges for me. I set up my ranges to be 100000 on the publication, 100000 on the subscriber, with a threshold of 80.

I would EXPECT to see the constraint
([AliasID]>(1300006) AND [AliasID]<=(1400006)) on the publisher and
([AliasID]>(1400006) AND [AliasID]<=(1500006)) on the subscriber.

However... what I do get is:

([AliasID]>(1300006) AND [AliasID]<=(1400006) OR [AliasID]>(1400006) AND [AliasID]<=(1500006)) on the publisher and

([AliasID]>(1500006) AND [AliasID]<=(1600006) OR [AliasID]>(1600006) AND [AliasID]<=(1700006))


Can anyone tell me why I get the OR... which essentially makes my identity ranges twice as large as they should be?

Thanks in advance.

- Alan D. Nelson

View 2 Replies View Related

Replication :: Merge Identity Value Out Of Sync

May 16, 2015

We are running merge replication. My identity value was out of sync and the inserts stopped working. I Reseeded the identity value to 1500000 and ran "sp_adjustpublisheridentity" which set that to the new range (and table constraint) in the MSMerge file and table. I discovered my error and Reseeded the table back to 150000. How to I get the new range to be created when it is LESS than 1500000 in the MsMerge file???? Can I use the sp_restoreidentity....???

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved