The purpose of the RemoveTagsFromData.exe tool is to remove tags and their content from your records in one or more database tables. The reason you may want to do this is not just to clean up your databases but also because Axiell Collections and the current WebAPI implement a strict policy concerning the definition of field tags: all tags used in records that you read or write using the WebAPI or Collections, must have been defined in the data dictionary (the .inf files). So when you’re about to start using this software you’ll either have to make field definitions for all undefined tags (using the ValidateDatabase.exe tool and Axiell Designer) or you’ll have to remove the undefined tags from your data using the RemoveTagsFromData tool.

Before you start removing tags you must be absolutely sure that you are not deleting valuable data, such as undefined link reference tags or screen tags for example. Basically, the procedure to follow is this:

1.Make a backup of your SQL database to start with (just to be safe).
2.Subsequently use the ValidateDatabase tool to check one or more of your database tables for any tags that have not been defined in the data dictionary and report on them.
3.Then use the RemoveTagsFromData tool with the check option to identify the records containing certain undefined tags. Or search on any of the problematic tags using Advanced search in Collections – e.g. use a search statement like: <tag> = *, and replace <tag> by the relevant field tag – to find the same records.
4.Now preferably check each identified or found record in the search result for the content of the tag: you can check all tags and their values stored in a record if you look at the record contents via one of the All fields ... reports in the Report viewer of Axiell Collections, while in detailed display mode.
Watch out for incidental tags that have only been defined on screen (associated with a screen field): the contents of these fields are properly stored in the database and you’ll want to keep them, but a field definition in the data dictionary is still missing. You can use Designer to search for screens possibly containing a specific undefined tag: unfortunately there’s no real quick way to determine if any of a list of undefined tags appears anywhere on a screen in the data source associated with the relevant database table. However, the contents of an undefined tag in some randomly picked records may give you an idea of the likeliness of the tag appearing anywhere on screen.
Also watch out for undefined tags starting with the lowercase letter “l”  and/or containing a number, especially tags like l1, l2, etc. as these could be link reference tags in use by linked fields: you should keep these tags and make a proper field definition for them, using Axiell Designer. In Designer you can check for every linked field if it uses a defined or undefined link reference tag by looking at the Forward reference property: if the property displays a field name, then the tag/field has been defined in the data dictionary all right; if the property displays just a tag, it probably hasn’t been defined.
5.Finally, if you are sure your undefined tag contains no valuable data, you can remove it from these records using the RemoveTagsFromData tool with the fix option.

When the procedure saves an edited record, no indexes will be updated! The updating of indexes is not required if you use the tool for its intended purpose, which is to delete tags that have entered your records unintentionally at one time or another, during an import or because of some adapl procedure for example. These tags won’t have indexes anyway because the fields themselves have never been specified in the data dictionary.

The RemoveTagsFromData.exe tool must be called from the operating system command line with the following syntax:

RemoveTagsFromData <data folder> [fix|check] [database table list | *] [tag list] [priref]

Everything between [ and ] is optional. | means: enter only one of both arguments. Leave out all brackets.

The <data folder> is mandatory. You can enter a relative path.
Use the literal value fix to remove all specified tags from the specified records or use check if you would just like to know in which records the specified tags have been found (and not remove any tags just yet). The default argument is check.
For the [database list], either specify a single database table name (the name of an .inf file with or without the .inf extension), use a comma-separated list of database table names (e.g. collect,document without a space behind the comma) or use * to check all database tables in the \data folder.
The [tag list] must be a comma-separated list of the field tags you wish to remove or check (e.g. T6,aA,w9 without a space behind the commas). Instead of specifying a list you can enter * to target all tags in the database table: with the fix argument this would effectively empty the specified records entirely (the records are not deleted but emptied)!
If a tag contains a smaller-than (<) or larger-than (>) character you need to escape that character by enclosing it in double quotes. So a field tag like <n needs to be entered as "<"n.
Use the optional [priref] argument to specify either a single record (its record number) from which the specified tags have to be removed or leave the argument out (or enter *) to fix or check all records in the specified database tables.

For example, if you placed the \RemoveTagsFromData folder containing the tool files as a subfolder in your Collections \data folder and call the executable from its own folder:

RemoveTagsFromData ..\ check collect BP

Example of a check result:

Started 12:11:01
Started checking database 'COLLECT.inf'
Found tag 'BP', occurrence '1' in record '151'
Found tag 'BP', occurrence '1' in record '153'
Found tag 'BP', occurrence '1' in record '154'
Found tag 'BP', occurrence '1' in record '155'
500 records processed, 0 records modified in 00:00:00, speed: 384142 recs/minute
Completed checking database 'COLLECT.inf'
Completed '569' records, modified '0' records

To write the result to a text file in the current folder, use a syntax like:

RemoveTagsFromData ..\ check collect BP > CheckRecords.txt

The result allows you to check these records manually first. To actually remove the tag and its contents from these records, you could execute:

RemoveTagsFromData ..\ fix collect BP

In this example the result would be:

Started 12:19:06
Started fixing database 'COLLECT.inf'
Found tag 'BP', occurrence '1' in record '151'
Found tag 'BP', occurrence '1' in record '153'
Found tag 'BP', occurrence '1' in record '154'
Found tag 'BP', occurrence '1' in record '155'
500 records processed, 4 records modified in 00:00:00, speed: 137012 recs/minute
Completed fixing database 'COLLECT.inf'
Completed '569' records, modified '4' records