none
Not able to configure second subscriber on transnational replication. RRS feed

  • General discussion

  • Hi,

    I am trying to add extra subscriber on already established transnational replication using below code.

                           

    TransSubscription subscription = new TransSubscription();
                            subscription.PublicationName = this.PublicationName;
                            subscription.SubscriberName = subscriber.SubscriberServerName;
                            subscription.DatabaseName = this.PublicationDBName;

                            subscription.ConnectionContext = this.ServConn;
                            subscription.SubscriptionDBName = subscriber.SubscriptionDBName;
                            subscription.CreateSyncAgentByDefault = true;
                            subscription.SubscriberSecurity.SqlStandardLogin = subscriber.SubscriptionLogin;
                            subscription.SubscriberSecurity.SqlStandardPassword = subscriber.SubscriptionLoginPassword;
                            subscription.SubscriberSecurity.WindowsAuthentication = false;
                            if (!subscription.IsExistingObject)
                            {
                                if (!this.IsSnapshotGenerated)
                                    GenerateFullSnapShot();

                
                                subscription.Create();

    But iam facing the the below issue , that is also on first run  from next run onwards could able to configure secondary subscription.

    "An error occrred while creating secondary subscription, Hence Installation will proceed with primary subscription only. Error: An exception occurred while executing a Transact-SQL statement or batch., Stack trace:    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
       at Microsoft.SqlServer.Replication.ReplicationObject.ExecCommand(String commandIn)
       at Microsoft.SqlServer.Replication.ReplicationObject.CommonCreate()
       at Microsoft.SqlServer.Replication.Subscription.Create()
       at Reporting.ConfigureReplication.CreateSubscription.CreateSubscriptions() in D:\Reporting\Reporting.ConfigureReplication\Tasks\CreateSubscription.cs:line 188, Source: Microsoft.SqlServer.ConnectionInfo, InnerException: System.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'snapshot_seqno_flag', table 'DISTRIBUTOR_UUD_AU_10.dbo.MSsubscriptions'; column does not allow nulls. UPDATE fails.
    Could not update the distribution database subscription table. The subscription status could not be changed.
    The subscription could not be created.
    The subscription could not be found.
    Changed database context to 'UUD_AU10_INT_TEST'.
    Job 'AU-UUD10-UUD_AU10_INT_TEST-PUB_AU10_INT_TEST-AU-UUD10-53' started successfully.
    Warning: The distribution agent job has been implicitly created and will run under the SQL Server Agent Service Account.
    The statement has been terminated.
       at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
       at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
    ClientConnectionId:9920c6b0-b69d-4c9b-9698-6a6db902cb36
    Error Number:515,State:2,Class:16, Exception Data: System.Collections.ListDictionaryInternal)"

    Friday, September 13, 2019 6:52 AM

All replies