# SQLExpress database sizing

**URL:** <https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 24, 2025, 3:07pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921 "2025-09-24T15:07:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larry\_Hardesty](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Larry\_Hardesty](https://forum.inductiveautomation.com/u/Larry_Hardesty)\
**Post date:** [September 24, 2025, 3:07pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921/1 "2025-09-24T15:07:14Z")

</div>

We have setup a SQLExpress database about 15 days ago. The database size has already grown to over 1GB. I know the size limit on a SQLExpress DB is 10 GB. Is there any documentation we can look at to trim this and is there a way that SQL will automatically prune data? We have pruning enabled in the gateway and set to 1 year. Obviously, we are not going to make it to one year. Any suggestions are appreciated.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [September 24, 2025, 3:15pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921/2 "2025-09-24T15:15:55Z")

</div>

If possible, consider switching to a more competent free database, such as postgreSQL. Max db size is \>100TB, and there is plenty of support available from large companies that are unlikely to go belly up(which is the main concern people have with these types of software)

If you are otherwise stuck with MSSQL, you are stuck with creating tasks in event scheduler to execute stored procedures/SQL scripts in your server via batch file.

Edit: SQL express doesn't have SQL Server Agent

> <https://stackoverflow.com/questions/7201061/how-to-create-jobs-in-sql-server-express-edition>

---

<div class="post-metadata">

**Author:** ![Larry\_Hardesty](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Larry\_Hardesty](https://forum.inductiveautomation.com/u/Larry_Hardesty)\
**Post date:** [September 24, 2025, 3:21pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921/3 "2025-09-24T15:21:56Z")

</div>

> [@ryan.white](#):
>
> postgreSQL

Would be able to pull our SQL DB into postgreSQL?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [September 24, 2025, 3:23pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921/4 "2025-09-24T15:23:36Z")

</div>

You should be able to, but there may be a bit of conversion work to be done as the base column types don't line up one-to-one. Generally you would have to export from SQL express (normally into a CSV) and them import into postgres.

> **[Microsoft SQL Server to PostgreSQL Migration by Ian Harding - PostgreSQL wiki](https://wiki.postgresql.org/wiki/Microsoft_SQL_Server_to_PostgreSQL_Migration_by_Ian_Harding)**

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 24, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921/5 "2025-09-24T15:39:55Z")

</div>

I agree with Ryan, but regardless of which DB engine you're using it can pay to keep an eye on usage. I wrote an app to monitor our DB use at a weekly meeting. It was quite handy - but it's not ready for distribution!

The app has (1) a dropdown to select the database to be monitored, (2) a date picker and (3) a duration dropdown.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/75929bda555bb4e4446b693ba3eb5d94056d6edd.png)

> **Dropdown options named query binding**
>
> ```python
> SELECT schema_name
> FROM information_schema.schemata
> WHERE schema_name LIKE 'hp_%'
> ORDER BY schema_name
> 
> ```

> **Dropdown options query binding transform**
>
> ```python
> def transform(self, value, quality, timestamp):
> objOptions = [{"label": 'default', "value": 'YourSchemaName'}]
> for row in value:
> objOptions.append({"label": row['schema_name'], "value": row['schema_name']})
> return objOptions
> 
> ```

> **Table Top 100 Historical Tags named query**
>
> ```sql
> SELECT a.tagid, COUNT(a.tagid) AS records, b.tagpath
> FROM {schemaName}.sqlt_data_1_{tableYear}_{tableMonth} a
> INNER JOIN {schemaName}.sqlth_te b ON a.tagid = b.id
> WHERE a.t_stamp > (UNIX_TIMESTAMP(:dateTimeStart) * 1000)
> AND a.t_stamp < (UNIX_TIMESTAMP(:dateTimeEnd) * 1000)
> GROUP BY a.tagid
> ORDER BY records DESC , a.tagid
> LIMIT 0 , 100
> 
> ```

Parameters for the table named query binding:  
{schemaName}: returned by dropdown (1).  
You should be able to figure out the rest.

We used the table to target tags above some nominal threshold and usually we found a stupid deadband setting which, when corrected, greatly reduced the data per day.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 26, 2025, 12:28pm UTC](https://forum.inductiveautomation.com/t/sqlexpress-database-sizing/110921/6 "2025-09-26T12:28:06Z")

</div>

> [@Transistor](#):
>
> It was quite handy - but it's not ready for distribution!

I think it would be a good candidate for the Exchange.
