How to convert a rich text field to plain text

A tool is available which will remove all rich text formatting from a notes field so that it is plain text instead. This can be useful if, for example, you wish to display data from a notes field on a report, since Reporting Services does not automatically handle rich text formatting.

It is important to note that this tool will convert ALL data in ALL rows for the field you specify. The conversion is irreversible, although text can still be manually given rich text formatting as normal afterwards. Therefore a backup of the database should be taken before using this tool.

The tool can be downloaded here.

Once downloaded, unzip the contents of the zip file to a location on your hard drive. For this example we will use C:\RichTextFix.

The tool is run from a command prompt:

  1. In Windows, click the Start button.
  2. Enter cmd in the search box and press enter.
  3. A command prompt will open. Navigate to the folder where you extracted the files by entering cd, a space, then the file path (then press enter). For example, cd c:\RichTextFix.
  4. Enter MemoEditRichText and press enter. This will display the list of parameters that the tool uses.

The mandatory parameters are as follows:

There are also two optional parameters:

For example, to convert the NOTES field on the VISITS table on a database called MaytasDB on a SQL server called MyServer\Instance, you would enter the following in the command prompt:

MemoEditRichText -server=MyServer\Instance -database=MaytasDB -uname=Maytas3 -pword=password -table=visits -column=notes

When you press enter, all data in the field will be converted to plain text. Please note that for fields with a lot of rows, this may take a short while (e.g. over 10 minutes).