Solutions Archive

Replication errors will have a key with which we should identify the missing row from the subscriber. We must then manually copy those records from Publisher and then insert into the subscriber. While doing this activity, we would have to turn off and turn on the identity column. In this article, we will learn how to deal with Unique keys in a replication.

Missing data:

Unique Keys In SQL Server Replication ErrorsConsider that you had initialized a subscription without a snapshot by using options like initialize with backup or initialize from log sequence number or replication support only. Before you change the configuration of the publication, some transactions can occur in the database and data might be changed. These changes will not get replicated. This will cause distribution agents to fail and your SQL Server error log might receive error messages to confirm that subscriber is missing some records or rows. You might also receive key violation error.

This can also happen when a user or an application deletes or adds records to the subscriber database.

Setup

The above said issue usually occurs when your replication was set up in any of following ways

  • SQL Server Replication ErrorsContinuous mode or a high frequent schedule is used for distribution agents
  • A long-running transaction has introduced a very big change in the data which in turn would develop a latency and stop the log reader agent
  • A same log reader agent is used to service multiple publications

Fix it

The first step to fix such issues is to identify IDs of commands that had failed. You should also identify transaction sequence numbers. You can easily do this using the replication monitor. If you prefer to use GUI, open the replication monitor and then navigate to the “Distributor to Subscriber History”. From the sessions of the distribution agent, select session that has errored out and then you can find the transaction sequence number from the error details section.
You can also use this script to fetch that information:

Use distribution
go
Select * from msrepl_errors
order by time desc
go

Use the transaction sequence number obtained from the previous script in this query:

Use distribution
go
Exec sp_browserreplcmds 'transaction sequence number' , 'transaction sequence number'
go

You can then continue to validate articles and identify missing records.

Turn On and Off

Now, if you manually try to push records into subscriber, you will receive an error stating that you are violating the primary key and the operation would fail. This is where the IDENTITY_INSERT comes into play. We must turn on this feature, insert records into our target table and then turn it off.

-- The statement below allows values to be inserted into the identity column 
SET IDENTITY_INSERT target_table ON
GO
-- Now SQL will allow you to insert values
INSERT INTO target_table(Col1, Col2) VALUES(anyvalye,anyvalue)
GO
--Turn of the IDENTITY_INSERT
SET IDENTITY_INSERT target_table OFF

When manually pushing records to Subscriber, please work with attention else you might end in corrupt mdf files.

Author Introduction:

Neil Varley is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including pst recovery and excel recovery software products. For more information visit www.datanumen.com

Be the first to comment

How to Work with Label Margins in MS Access

Posted January 20, 2018 By AuthorVS2

In this article, we have addressed how user can use label margins in MS Access

A good designed and structured Report or Form is more likely to catch the eyes of the onlookers than a plain bland data record. All organizations, businesses, and programmers design them.  But the problem with assigning different people to design the same Report or Form is that they are going to design them according to their preferences and taste unless they are all using the same default wizards.Working With Label Margins In MS Access

Some users might focus on the information stored in a report, and their structure and order, but it is also important to make it presentable in a given time. If you put the right amount of effort in the report, it is likely to pay you back. As the office reports travel from place to place via Emails or faxes. And if compared to other reports your masterpiece is able to impress your boss. Fortunately, MS Access offers multiple designing tools which can make your forms and reports strikingly beautiful.

Now let’s talk about some of these properties offered by label margins in MS Access

  • WLabel Marginizards come with a default formatting, which maintains (Font, style, text, size) ratio of the content, saving a good amount of time. Users can also modify them according to their requirements. Users can also insert tables, graphs etc in their reports to make them more comprehensible.
  • For changing the values in the Sheet users need to select View and then open its properties.
  • Users can also align the text in their reports by selecting Format > Align > Left/Right/Center. The heading or the name of the company should be placed in the center, whereas the subject of the report should be aligned from the left side.
  • Users can also insert Borders or Headers in the report. They can change the color, structure of the type of line, by going in the properties of the report.
  • Users can also insert and edit the thickness of the margin in their reports. Margins promote better division structure, separating headings from detail section. In order to change the Property value of their Header Label, users can go to the properties of Top Margin and change its value to their desired size.

Note: Users can make any changes in their forms or reports using label margins. However, these changes should be able to present the essence of the content present in the database. Like any other report, it is important, that it is structured with a futuristic and professional outlook, as it is likely to be used in the future for inserting new data or entries in it. It is also important that size of the headings and the subheading is differentiated and highlighted so that it becomes easier for the readers to locate different sections of the reports. A good report is one which contains all the necessary research work, in an organized way which can be understood by even an amateur. A well-designed report conveys the meaning of the content 10 times more efficiently to the users compared to plain report without any categorizations or division of paragraphs.

Every business user of MS Access needs to keep in place contingency plans to deal with a corrupted Access database. So if you too are using MS Access for business, do ensure you do regular backups and have powerful recovery tool DataNumen Access Repair handy.

Author Introduction:

Vivian Stevens is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql fix and excel recovery software products. For more information visit www.datanumen.com

Be the first to comment

To change the body of a received or sent email in Outlook, you have to open it and then turn it into “Edit” mode. If you often need to make modifications in such emails, you’ll wish to open them in “Edit” Mode automatically. This post will help you get it.

At times, you may need to alter the content of a received or sent email in Outlook. In this scenario, as introduced in the previous post – “How to Modify the Subject & Body of Received Emails in Outlook“, you have to open the email and click the “Actions” button and choose “Edit Message” to convert the email into “Edit” mode. However, you may think it still a bit troublesome. Therefore, you wish Outlook to always open received/sent emails in “Edit” mode. Thereinafter, we will introduce how to use VBA code to achieve this function. Now read on to get detailed steps.

Edit Message

Open Received/Sent Emails in “Edit” Mode Automatically

  1. At the very outset, with reference to “How to Run VBA Code in Your Outlook“, access Outlook VBA editor.
  2. Then, copy and paste the following VBA code into the “ThisOutlookSession” project.
Public WithEvents objInspectors As Outlook.Inspectors
Public WithEvents objMailInspector As Outlook.Inspector

Private Sub Application_Startup()
    Set objInspectors = Outlook.Application.Inspectors
End Sub

'Get the email window
Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)
    If TypeOf Inspector.CurrentItem Is MailItem Then
       Set objMailInspector = Inspector
    End If
End Sub

Private Sub objMailInspector_Activate()
    Dim objMail As Outlook.MailItem
 
    Set objMail = objMailInspector.CurrentItem
    'If it is a recieved/sent mail instead of a new email
    If Not (objMail.Recipients Is Nothing) And Not (objMail.Sender Is Nothing) Then
       'open in "Edit" mode
       objMailInspector.CommandBars.ExecuteMso ("EditMessage")
    End If
End Sub

VBA Code - Open Received/Sent Emails in "Edit" Mode Automatically

  1. Afterwards, click into the “Application_Startup” macro and press “F5” key.
  2. At present, close the VBA editor.
  3. Finally, you can have a try. Just double click on a received or sent mail to open it. It will surely in the “Edit” mode.Emails in "Edit" Mode

Immune from Outlook Data Loss

Have your PST file ever become inaccessible? In reality, Outlook PST file can get corrupt readily. For instance, email borne viruses can easily lead to Outlook crash and thereby result in Outlook data corruption. In such cases, the first resolution happening to your mind may be inbox repair tool. However, generally speaking, it is incapable of dealing with such serious situations. Hence, it is always suggested to back up PST files at regular intervals, such that you can restore PST data from backups like a cork. Otherwise, you have to fall back on a specialized external tool, like DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf recovery and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment