Are you the publisher? Claim or contact us about this channel

Embed this content in your HTML


Report adult content:

click to rate:

Account: (login)

More Channels


Channel Catalog

Channel Description:

Discussions on SQL Server Replication

older | 1 | .... | 117 | 118 | (Page 119) | 120 | 121 | .... | 181 | newer

    0 0

    Hi All, 

    Environment details:
    SQL server 2005 SP4 on all servers below.
    Server A -- PRINCIPAL
    Server B -- MIRROR
    Server C -- REPLICATED DB (need to set this up from A to C.)

    Database: test 

    Actions done:
    1. DB mirroring (without witness) has been setup from Server A to Server B.

    I need to setup replication for a subset of tables (say 3) and only some of the columns of these tables.

    1. Is this possible?
    2. Are there steps which I can follow? 

    NOTE: In our scenario, it is ok for the replication to break when there is a DB mirror failover from Server A to Server B. Requirement is only to setup replication from Server A to Server C.

    0 0

    Morning all.
    I have a problem with a custom conflict resolver stored proc. 

    Publisher - SQL 2008 Enterprise
    Subscribers sql 2008 Express - there are ~400 subscribers. These are fluid to a degree as people leave\join the company

    I have been looking(slightly apprehensively) into the possibility of using a custom conflict resolver, and been doing some testing. 

    I have created a SP that creates a linked server to the subscriber instance, pulls back the data it needs
    from the subscriber DB, and drops the linked server once done.

    My test works ok if I set up the proc to run on the publisher, but when it runs as part of a proper sync
    I get the error "The Stored Procedure Resolver encountered the following error ... Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    Looks like it could be a kerberos issue , but I have remotely connected to both publisher and subscriber instances and verified that kerberos is used.

    Any widom as to where I need to look to try and resolve this from here would be appreciated.

    Thanks !

    0 0

    Need some help with my sql 2008 R2 merge replication.  The snapshoot agent is stuck at sp_MSmakegeneration. I've tried runningsp_mergemetadataretentioncleanup and still nothing. Any help is highly appreciated.


    0 0

    I have P2P with 3 nodes(A,B,C) , and hope to update lots of data at A,B,C, so I setup one transaction replication (one way) on A, and choose only replicate proc execution (not choose those based tables here) . When I run "exec proc" at A I can see same "exec proc" running at B and C, but after running done, the A node undelivered cmds show all cmds are waitting to deliver... (I use browsereplcmd to get the cmds are exactly contents of the stored proc! )  and then I have to do much clean up jobs.

    Can I avoid such loop back replication? Thanks in advance!    version: sql 2012 

    0 0

    If we have SQL Server 2005 Express Merge Replication Subscriptions that synch to a SQL Server 2008 R2 Standard Edition. Do the Subscriptions still have same file size limitations even though they synch to a Proper Standard Version of SQL Server 2008?

    If so what are these limitations?

    What happens in the instance where by the server file becomes huge then the Subscriptions will not allow the data to replicate as the Express Subscription engine has a file size limitation - or does this not matter??

    0 0

    When you get the msg "The initial snapshot for publication is not yet available......"
    The distrib agent is expecting a snapshot to deliver but the snapshot is not available because it was intentionally cancelled.
    Is there a way to reset this situation so that the distrib agent continues to deliver commands without applying the snapshot and without the need to reinint the sub?

    Yaniv Etrogi
    site | blog | linked in | mail
    Please click the Mark as Answer button if a post solves your problem! orVote As Helpful

    0 0

    I will apreciate any help on this, thanks ahead!

    We are running the below script that works well for us at dev and other environments but when running on prod the generated snapshot is for all articles in the publication rather than the desired results, for the new art only.

    I have copied below the code being used.

    DECLARE @rc int, @publication sysname, @article sysname, @subscriber sysname, @destination_db sysname
    			 ,@delete_article_from_replication_configuration bit ,@debug bit = 1;
    SELECT @publication			= N'MyPub'
    			,@destination_db	= N'dest_database'
    			,@subscriber 			= N'MyServer'
    SELECT @article					= N'MyArt'
    -- SET immediate_sync and allow_anonymous to false
    EXEC sp_changepublication
    			@publication	= @publication,
    			@property			= N'immediate_sync',
    			@value				= N'false';
    EXEC sp_changepublication
    			@publication = @publication,
    			@property		 = N'allow_anonymous',
    			@value			 = N'false';
    -- add article
    DECLARE @error_message nvarchar(4000);
    IF NOT EXISTS (SELECT * FROM dbo.sysarticles a INNER JOIN dbo.syspublications p ON a.pubid = p.pubid WHERE = @article AND = @publication)
    EXEC @rc = sp_addarticle
    		 @publication					= @publication
    		,@article							= @article
    		,@source_owner				= N'dbo'
    		,@source_object				= @article
    		,@destination_table		= @article
    		,@type								= N'logbased'
    		,@creation_script			= null
    		,@description					= null
    		,@pre_creation_cmd		= N'none'
    		,@schema_option				= 0x000000000803100D /* 0x000000000803FFDF */
    		,@status							= 16 /* 8 */
    		,@vertical_partition	= N'false'
    		,@ins_cmd 						= N'SQL'
    		,@del_cmd 						= N'SQL'
    		,@upd_cmd 						= N'SQL'
    		,@filter							= null
    		,@sync_object					= null
    		,@auto_identity_range	= N'false'
    		,@identityrangemanagementoption = N'manual';
    IF ( (@@ERROR <> 0) OR (@rc <> 0) )
    	SELECT @error_message = ERROR_MESSAGE(); RAISERROR(@error_message, 16, 1);
    PRINT 'The article ''' + @article + ''' has been added to publication ''' + @publication + '''';
    -- add subscription
    IF NOT EXISTS (SELECT * from syssubscriptions WHERE dest_db NOT LIKE 'virtual' AND srvname LIKE @subscriber AND artid IN
    		(SELECT artid FROM dbo.sysarticles a INNER JOIN dbo.syspublications p ON a.pubid = p.pubid WHERE = @article AND = @publication ))
    EXEC @rc = sp_addsubscription
    			 @publication					= @publication
    			,@subscriber					= @subscriber
    			,@destination_db			= @destination_db
    			,@subscription_type 	= N'Pull'
    			,@sync_type						= N'automatic'
    			--,@sync_type						= N'replication support only'
    			,@article							= @article
    			,@update_mode					= N'read only'
    			,@subscriber_type			= 0
    			,@subscriptionstreams = 4;
    IF ( (@@ERROR <> 0) OR (@rc <> 0) )
    	SELECT @error_message = ERROR_MESSAGE(); RAISERROR(@error_message, 16, 1);
    PRINT 'The subscription ''' + @subscriber + ''' for article ''' + @article + ''' has been created''';
    EXEC sp_changepublication
    				 @publication								= @publication
    				,@property									= N'sync_method'
    				,@value											= N'native'
    				,@force_invalidate_snapshot = 0
    				,@force_reinit_subscription = 0;
    -- create snapshot
    EXEC sp_addpublication_snapshot
    				 @publication										= @publication
    				,@frequency_type								= 1
    				,@frequency_interval						= 1
    				,@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;

    Yaniv Etrogi
    site | blog | linked in | mail
    Please click the Mark as Answer button if a post solves your problem! orVote As Helpful

    0 0


    Please help.

    Whenever i am trying to add subscription

    exec sp_addsubscription @publication = N'DB_NEW',
    @subscriber = N'SERVER1',
    @destination_db = N'DBNAME',
    @subscription_type = N'Push',
    @sync_type = N'initialize with backup',
    @article = N'all',
    @update_mode = N'read only',
    @subscriber_type = 0,
    @backupdevicetype = N'disk',
    @backupdevicename = 'C:\DBfile.bak'

    i am getting below error.

    Msg 14068, Level 16, State 1, Procedure sp_MSrepl_changesubstatus, Line 1353 The subscription status of the object could not be changed.

    Msg 14057, Level 16, State 1, Procedure sp_MSrepl_addsubscription_article, Line 383 The subscription could not be created.

    Msg 20021, Level 16, State 1, Procedure sp_MSrepl_addpushsubscription_agent, Line 258 The subscription could not be found.

    Let me how to resolve this kind of issue.

    0 0

    Hi Everyone,

    We have a Transactional replication in SQL SERVER 2008R2, in which we are publishing 7-8 articles. Some of these articles are very large tables. we have two subscribers for this publication.

    Now we want to add a new column  to one of the articles in this publication. Is there an easy way to do that  without intialization of subscribers? If I add them directly to the article it will ask me to create a snapshot and reintialize the subscribers, which will be an outage for us.

    I would appreciate fi someone help me on this issue.



    0 0

    Hi All,

    Am building a Transactional replication between geographically different continents, While applying the Snapshot replication I got a error

    The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "Constraint_Name". The conflict occurred in database "DB_Name", table "dbo.Table_Name", column 'Column_name'.

    Though I changed the constraint to 'Not' for replication and 'Not' for FK The error caused the snapshot replication to re-initializ and started applying from the first scripts. Due to geographical distance the snapshot was running for more than 3 days, now again re-initialized which is very bad news..

    I even received the message 'Delivered snapshot from the 'unc\XXX\' sub-folder in 136426328 milliseconds',  the error occurred while creating primary key index on table

    Is there anyway to overcome this? Please shed some light on this..

    Best Regards Moug

    0 0


    Currently i have 2 servers with same structure of dbs like server 5 and server 6, i want to replicate all data from server 5 and server 6 to another server which is server 7.

    Currently i am using sql server replication through transaction publication which is enable me to replicate server 5 data to server 7, but server 6 data is not replicate to server 7, its gives error like snap shot agent and log reader agent is not available.

    How can i merge Server 5 and server 6 data to server 7, which Technic is better to merge data from 5 6 to 7.

    Kindly guide me


    0 0

    Hello Guys,

    Recently performed a side by side SQL server migration from 2000 to 2012 version, due to emergency upgrade,

    i forgot to check HA before migration on SQL 2000 , migration completed successfully , but missed the

    transactional replication.

    Application is live from new SQL 2012 instance , as we know we can't configure trasactional replication from

    SQL 2012 to SQL 2000 instance , there are about 12-15 Articles which is getting replication from publisher to

    subscriber , So guys need urgent help .......

    Do we have anyother alternative to Transactional replication , where in i can replicate my articles......???

    your help willbe highly appriciated.




    0 0

    I've got 2 publisher servers - CORP and PROD - each with remote distributors on different machines.

    I want to set up new VM server STAGE (SQL 2012) and publish both snapshot and transactional daily replications to STAGE.

    I set up a password for Distributor on STAGE - but don't know how to tell the 2 publishers what it is, and not sure what account it's using (I made all the agents <domain>\MSSQLSERVACCT. 

    When I tried to test connectivity via SQLCMD with that acct/password, I got

    Msg 18456, Level 14, State 1, Server <stage> Line 1
    Login failed for user '<domain>\MssqlServAcct'.

    CORP and PROD are on one cloud, STAGE is on a different cloud.

    All subscriptions show 'uninitialized' in Replication Monitor.

    Most tables are replicated with same row counts between source and target.

    0 0


    I have a replication setup with master and 2  slaves, lets say if the master database freezes or gets corrupted is there a way switch the master to salve and vice versa automatically to get the database available all times.


    Naveen| Press Yes if the post is useful.

    0 0

    Hi All,

    I have created a replication for single database with 6 publications

    Now when I am executing snapshot for particular publisher its blocking all other publication

    And  frequently I am getting following error

    The INSERT statement conflicted with the FOREIGN KEY constraint

    0 0

    Can someone provide me with a link or a list explaining to me the differences between Replication and a database mirror? I'm referring to SQL 2005. Thank you'll so much.

    0 0

    How the transactional replication work for simple recovery database (looking for some internal concept)


    0 0
  • 12/30/10--18:18: error with snapshot agent
  • I have been running snapshot replication for around 2 months succesfully without any error. Publisher & Subscriber are SQL server 2008. Now i am getting the following message from the sql agentjob history. Looked up in the forum & search did not yield any match. please help resolve this ?

    2010-12-31 01:52:09.24 Microsoft (R) SQL Server Snapshot Agent
    2010-12-31 01:52:09.24 [Assembly Version =, File Version = 10.0.1600.22 ((SQL_PreRelease).080709-1414 )]
    2010-12-31 01:52:09.24 Copyright (c) 2008 Microsoft Corporation.
    2010-12-31 01:52:09.29 The timestamps prepended to the output lines are expressed in terms of UTC time.
    2010-12-31 01:52:09.29 User-specified agent parameter values:
    2010-12-31 01:52:09.29 --------------------------------------
    2010-12-31 01:52:09.29 -Publisher XYZ
    2010-12-31 01:52:09.29 -PublisherDB abc
    2010-12-31 01:52:09.29 -Publication abc_SnapPub031110
    2010-12-31 01:52:09.29 -Distributor XYZ
    2010-12-31 01:52:09.29 -DistributorSecurityMode 1
    2010-12-31 01:52:09.29 -XJOBID 0x9B8B5D4AB8BC8249AB262B59DCD242FD
    2010-12-31 01:52:09.29 --------------------------------------
    2010-12-31 01:52:09.29 Connecting to Distributor 'XYZ'
    2010-12-31 01:52:10.38 Parameter values obtained from agent profile:
    2010-12-31 01:52:10.38 ---------------------------------------------
    2010-12-31 01:52:10.38 -BcpBatchSize 100000
    2010-12-31 01:52:10.38 -HistoryVerboseLevel 2
    2010-12-31 01:52:10.38 -LoginTimeout 15
    2010-12-31 01:52:10.38 -QueryTimeout 1800
    2010-12-31 01:52:10.38 ---------------------------------------------
    2010-12-31 01:52:10.49 Connecting to Publisher 'XYZ'
    2010-12-31 01:52:10.62 Publisher database compatibility level is set to 100.
    2010-12-31 01:52:10.63 Retrieving publication and article information from the publisher database ''
    2010-12-31 01:52:10.99 The replication agent had encountered an exception.
    2010-12-31 01:52:10.99 Source: Replication
    2010-12-31 01:52:10.99 Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentSqlException
    2010-12-31 01:52:10.99 Exception Message: Specified cast is not valid.
    2010-12-31 01:52:10.99 Message Code: 52006
    2010-12-31 01:52:10.99 
    Version string portion was too short or too long.

    0 0

    Hello everyone,

    I'm having an odd issue, that I need some help understanding.  I've got a number of tables enabled for Change Data Capture, but I've noticed some behavior that doesn't make sense.

    I am utilizing CDC to populate an ODS via SSIS packages, and have noticed a few instances where I'm getting a delete operation come through, but the source record still exists.  In the source system, I can query 'cdc.fn_cdc_get_net_changes_...' and see combinations of 1 (delete) and 4 (update new) for the __$operation.

    __$start_lsn, __$operation, TableId, ...
    0x000BB75700002F250005, 1, 1938241
    0x000BB75700002F250005, 4, 1938241

    Also, if I query the cdc.<Table>_CT table directly, I see pairs of 1 and 2 (insert) for the same __$start_lsn and __$seqval.  How can this happen?  If I get *net* changes, shouldn't I only get one record back per the primary key of the source table?

    __$start_lsn, __$seqval, __$operation, __$update_mask, TableId, ...
    0x000BB75700002E7C0005, 0x000BB75700002E7C0003, 1, 0x0FFF, 1938241
    0x000BB75700002E7C0005, 0x000BB75700002E7C0003, 2, 0x0FFF, 1938241
    0x000BB75700002F250005, 0x000BB75700002F250003, 1, 0x0FFF, 1938241
    0x000BB75700002F250005, 0x000BB75700002F250003, 2, 0x0FFF, 1938241

    Let me say, I've got a trace going to see if I can find the command(s) that is causing the duplicate results, but has anyone ever seen this before? 

    Thanks in advance for your time and help!


    0 0

    Hi All,

    Is it possible to set up replication between SQL Server 2014 and Sybase 12.5 in which SQL server would be the publisher and Sybase as  subscriber.



older | 1 | .... | 117 | 118 | (Page 119) | 120 | 121 | .... | 181 | newer