---
title: Adding measurements to an SQL collector
slug: how-tos/aIGN-adding-measurements-to-an-sql-collector
docTags: YJjjN8aKCWH9DMgtUkuwJ,GOo15ntkoXThxPf_Z8vVm
createdAt: 2025-09-24T13:17:10.212Z
---

Measurements can be added to an SQL collector by:

- Manually adding measurements
- Bulk importing measurements
- [Adding measurements using the API](docId\:oCUYPOPzCoUIhWWzC_VJ7)

## Manually add a measurement

:::hint{type="info"}
Follow the guide on [Creating a measurement](docId\:u5-07YlMs2jiX9Kz-m-lB) for general instructions on how to create a measurement.
:::

Once the collector is successfully configured, you can add one or more **measurements**. A measurement defines which results from your SQL query map into Historian.

To create a new measurement manually, open the **Measurements** page in the Factry Historian web interface and click **+ Create Measurement**.

### Basic settings

- **MeasurementKey**: Maps the measurement\_key column from the query result. (Required)

For example, looking at this query from the [SQL collector configuration](docId\:JGCek7sjj-9dntSxr9Zqt):

```sql
SELECT
  s.id AS measurement_key,
  s.value AS value,
  s.timestamp AS ts,
  s.updated AS updated,
  'Good' AS quality,
  t.line_nr AS tag_line_nr
FROM sensors s
INNER JOIN tags t ON s.pk = t.sensor_pk
WHERE updated > ?;
```

The output might look like this:

| measurement\_key | value | ts                   | updated              | quality | tag\_line\_nr |
| ---------------- | ----- | -------------------- | -------------------- | ------- | ------------- |
| sensor\_temp     | 14    | 2025-09-10 00:00:30Z | 2025-09-10 02:00:42Z | Good    | 45            |
| sensor\_volume   | 100   | 2025-09-10 00:13:45Z | 2025-09-10 00:15:30Z | Good    | 6             |
| sensor\_weight   | 66    | 2025-09-10 00:21:40Z | 2025-09-10 00:33:30Z | Good    | 2             |

In this case, you would enter **sensor\_temp**, **sensor\_volume**, or **sensor\_weight** as the `MeasurementKey` when creating a measurement in Historian.

Please take into account the warning about tag cardinality in our [Data model](docId\:b6BfdKcZA5V8hIdjzxQ1h).
