IMD SolutionComputing LibraryShop main store

Troubleshooting

Historian tagnames showing a ? prefix mean hidden spaces

Edge computing and IIoT Published 7 min read

Short answer

A ? prefix on a tagname in an aahDBDump export marks a hidden space-type character in the stored name, not a corrupt tag or lost history. Find every affected tag with a CHARINDEX query on dbo.Tag in the Runtime database, then rename them with the aahTagRename utility (TN Hist235), which preserves history and needs Historian stopped and disabled under store-and-forward protection.

On this page
  1. What does the ? in front of a tagname mean?
  2. Why does SMC show a clean name while the query fails?
  3. How do you list every tag with the hidden character?
  4. Can you clear the ? without stopping Historian?
  5. How do you run the rename safely?
  6. How do you confirm the rename fixed it?
  7. Questions asked

The ? at the start of a tagname in an aahDBDump export is not a corrupt tag and not lost history: it is a hidden space-type character in the stored tagname, which the dump's text conversion renders as a question mark and the query parser rejects as Unsupported tags in the query. On the installation behind this article, 13 of 1,900 tags carry it — 9 analog and 4 discrete out of 1,400 analog and 500 discrete — and they trend normally while every text-based consumer fails. List them with one query against dbo.Tag, then remove the character permanently with the aahTagRename utility (TN Hist235), planned around a Historian stop that store-and-forward buffering protects.

What does the ? in front of a tagname mean? #

It means the stored tagname contains a leading or embedded space-type character that the export converts to ?, and on this system that is 13 tags out of 1,900 — 9 analog and 4 discrete — while the remaining 1,887 export clean.

The tag is healthy; its name is not. The same tag collects, stores and trends, which rules out a storage fault, and the failure appears only where the tagname is turned into text: an export line or a generated query. That combination is a tagname-encoding fault, and it produces this pattern:

Where you look What you see What it tells you
SMC tag configuration A normal tagname, no ? The configuration grid shows the stored string without revealing the stray character
HistorianDatabase.txt from aahDBDump ? at the start of 9 analog and 4 discrete tagnames The export replaces a character it cannot represent with ?
Historian Client Trend, TagPicker Tagnames look normal, values trend Storage and retrieval by tag key work; the history is intact
Historian Client Query, History Values The query fails for the affected tags The generated SQL embeds the stray character, so name matching fails
The query's SQL tab Empty spacing inside the tagname The stray character is a space-type character in the name
The third-party program Unsupported tags in the query. The same failure: the name text does not match what the parser accepts

Why does SMC show a clean name while the query fails? #

Because the three paths treat the stored string differently: SMC and TagPicker display or pass the name unchanged, the dump converts the character to ?, and query generation embeds it in the SQL text, where it breaks matching and the tag reads as unsupported.

Historian keeps tagnames as text in its SQL Server configuration, and a space-type character is invisible in a grid, so every GUI that renders the name looks clean. An AVEVA case record describes this exact sequence: manual tags exported from SMC carried a ? prefix, Trend plotted them, Query failed on History Values, the SQL tab showed empty spacing inside the name, and deleting that spacing made the query run. The same record references a developer investigation and a hotfix, with no number visible in the case text, so treat the hotfix as something to confirm with AVEVA Technical Support rather than wait for.

Field reports from several System Platform galaxies attribute the character to regional settings or SQL collation differences at the time the tags were created or imported; that mechanism is plausible but unconfirmed for any given site. The first-character code from the next section's query settles it for yours: 32 is a plain ASCII space, anything above 127 is a non-ASCII lookalike, and both fail the same way.

How do you list every tag with the hidden character? #

Query dbo.Tag in the Runtime database for a space inside TagName, and flag any first character below code 33 or above 127 as well; on the installation here that returns 13 rows, and those rows are the rename map.

Do not count on the dump: it marks only what its code page cannot represent, so the query, not the dump, is the authoritative list. TagName is the documented column; the three aliases are illustrative labels for this diagnostic.

SELECT TagName,
 UNICODE(LEFT(TagName, 1)) AS FirstCharCode,
 LEN(TagName) AS LenChars,
 DATALENGTH(TagName) AS LenBytes
FROM dbo.Tag
WHERE CHARINDEX(CHAR(32), TagName) > 0
 OR UNICODE(LEFT(TagName, 1)) > 127
 OR UNICODE(LEFT(TagName, 1)) < 33
ORDER BY TagName;

The SELECT changes nothing, so it is safe to run against the live database.

Worked example on this installation's numbers: 1,400 analog plus 500 discrete is 1,900 stored names, and the query returns 13 rows — 9 analog and 4 discrete, which is 13 ÷ 1,900 = 0.7% of the database. One row shows the name SMC displays as AB00223F.In, 11 visible characters, with FirstCharCode 32, LenChars 12 and LenBytes 24. If TagName is NVARCHAR at 2 bytes per character, 24 ÷ 2 = 12 characters are stored and 12 − 11 = 1 of them is hidden; with a first-character code of 32, that hidden character is a plain ASCII space leading the name. A row reading 160 is a non-breaking space — same symptom, same fix.

Can you clear the ? without stopping Historian? #

No. The documented permanent fix is the rename, and it requires Historian stopped and disabled while the utility runs; every no-stop alternative leaves the bad name stored and pushes a workaround onto each client, so plan the stop instead of avoiding it.

Approach What it changes Historian downtime Permanence Verdict
Delete the spacing in each query's SQL text That one client query None Every regenerated query rebuilds the bad name Proof of cause, not a fix
Strip the character in the third-party program's builder The third-party side None Fragile, and the fault stays in the source Stopgap
Hotfix referenced in the AVEVA case The software's query path Depends on the hotfix Names already stored stay as they are Only with support confirming your version
Rename with aahTagRename.exe The stored tagname, history preserved Stop and disable during the run Permanent for every consumer The fix for the 13 tags

The stop is the objection raised on this installation, and store-and-forward is the answer to it. Sources running System Platform or remote IDEs in store-and-forward mode buffer locally and replay after restart, the same recovery sequence behind how MQTT store and forward backfills data after a connection outage. A feed that reaches the historian over MQTT from an edge device covers the window only if you have configured source device's MQTT store-and-forward for data backfill. A source with no buffering loses the stop window's data, so schedule around it.

How do you run the rename safely? #

Build the 13-entry map from the query output, confirm buffering on every source, back up the configuration, then stop and disable Historian, run aahTagRename.exe against the map, and start again, in that order.

  1. Save the dbo.Tag query output: the affected tagnames and their first-character codes are the rename map.
  2. Choose each new name as the name SMC displays, stray character removed, and confirm no existing tag already holds it.
  3. List every consumer of those names — the third-party program, trends, reports, saved queries — so each can be repointed afterwards.
  4. Verify store-and-forward on each source and schedule the stop for a low-activity window.
  5. Take a SQL backup of the Runtime configuration database, then follow TN Hist235 for the exact syntax. The utility is documented at C:\Program Files (x86)\Wonderware\Historian\X64\aahTagRename.exe and supports tag-by-tag assignment; the Historian driver's RenameTag method is a programmatic alternative, but for 13 tags the utility is the auditable path. Do not guess a command line against a production archive.
  6. Stop and disable Historian as the procedure requires, run the rename, then re-enable and start. One support-case record reports that after a disable-and-re-enable cycle sources can fail to reconnect to tags that did not change, and that a reboot re-establishes them, so size the window for that reboot.
  7. Repoint the consumers to the new names.

Make the change only through the utility. A direct UPDATE against dbo.Tag is unsupported: the tagname is carried across the configuration and the archive, and editing the table can orphan the history the rename is meant to preserve.

How do you confirm the rename fixed it? #

Three checks in order: the dbo.Tag query returns zero rows, a fresh aahDBDump shows no tagname starting with ?, and Historian Client Query returns history rows for every renamed tag with no stray spacing in the SQL tab.

  • Re-run the dbo.Tag query and confirm zero rows.
  • Re-run aahDBDump and confirm no tagname in HistorianDatabase.txt starts with ?.
  • Select each renamed tag in TagPicker and view History Values: rows return and the SQL tab shows the clean name.
  • Confirm the third-party program connects and stops returning Unsupported tags in the query.
  • Trend across the stop window to see the store-and-forward replay where sources buffered.

Decision for this installation: rename all 13 tags in one planned window under store-and-forward protection, keep the query-text edits as the diagnostic that proved the cause, take the backup before the utility runs, and plan the post-rename reboot. Waiting on a hotfix changes the software's behavior, not the names already stored, so it is not the path to clean tagnames.

Questions asked

Will renaming the tags lose their logged history?

No. AVEVA's documentation for the Tag Rename Utility states that it renames tags while preserving the historical data associated with them, which is why it is the documented path rather than delete-and-recreate. After the rename, trends and queries read the same history under the new name. Trend across the stop window before you repoint clients to confirm the replay.

How do I keep new tags from picking up the same hidden character?

You cannot fully control it at the historian side, because field reports tie the character to regional settings or SQL collation at tag creation or import time. Inspect import files for leading spaces before loading them, keep server regional settings consistent, and re-run the dbo.Tag query after every bulk import so a stray character is caught within a day rather than years later.

Is the hotfix from the AVEVA case record enough on its own?

No. The case record references a hotfix for the query code path, but a software patch does not remove characters already stored in tagnames, and the case text shows no hotfix number to match against your version. Run the dbo.Tag query regardless of patch level, and confirm applicability with AVEVA Technical Support before scheduling anything around it.

What if the dbo.Tag query finds more tags than the dump flagged?

Rename those too. The dump marks only characters its code page cannot represent, so a name can carry a space-type character and still export without a question mark. The query is the authoritative count because it reads the stored string directly; treat its row list, not the dump's marks, as the complete rename map.

Keep reading

  • Troubleshooting

    Citect SCADA connector to Historian shows disconnected

    A "Disconnected" destination status means the Citect SCADA Connector has no session to Historian and is buffering samples to local disk. SMC tag-discovery and write entries prove the connector's stages, not that values were archived. Stop the connector, verify the destination instance, services and write authorization, reconnect once, and close only when a query returns a sample and the buffer drains.

    Edge computing and IIoT

  • How-to

    Export historian trend CSV at one-minute intervals

    Export the trend's recorded values and you get change-based events, about 17 minutes apart in this case, because the historian stores a value only when it changes. To get one row every minute, query the tag in the Query tool with regularly spaced retrieval at a 60-second interval and export that result; the grid comes from retrieval, not storage.

    Edge computing and IIoT

  • Troubleshooting

    Historian stores zero after an MQTT edge node reconnects

    A 0 stored just before the true value at every MQTT edge reconnect is a reported pattern on Ignition 8.1.5 through 8.1.15 with the MQTT Transmission and Engine modules 4.0.6 through 4.0.10. Confirm it by querying stored records around each reconnect, exclude those zeros from process data, and remove them with a timestamped rule instead of a blanket zero filter.

    Edge computing and IIoT