Error "TagHistoryDatasourceSink" caused by wrong storage provider

Hi, I wrongly set the "History storage provider" property of some tags to the wrong database.

As soon as I noticed the mistake I change the storage provider to the right one; since then I have this errors in the log

There is a problem checking the tag history database tables during initialization of the store and forward engine which could prevent tag history data from being forwarded properly. Trying again in 60 seconds.

I checked in the wrapper logs and I have this error

INFO   | jvm 1    | 2024/07/25 09:59:12 | W [S.S.TagHistoryDatasourceSink  ] [09:59:12.730]: There is a problem checking the tag history database tables during initialization of the store and forward engine which could prevent tag history data from being forwarded properly. Trying again in 60 seconds. 
INFO   | jvm 1    | 2024/07/25 09:59:12 | java.lang.Exception: Error running query: CREATE TABLE sqlth_drv ("id" int IDENTITY(1,1),"name" nvarchar(255),"provider" nvarchar(255),PRIMARY KEY CLUSTERED ("id"))
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.executeCommandSet(DBTableSchema.java:140)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.createTable(DBTableSchema.java:109)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.verifyAndUpdate(DBTableSchema.java:91)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.checkTables(TagHistoryDatasourceSink.java:1655)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.initialize(TagHistoryDatasourceSink.java:295)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:550)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO   | jvm 1    | 2024/07/25 09:59:12 | 	at java.base/java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2024/07/25 09:59:12 | Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: CREATE TABLE permission denied in database '**myName**'.

How can I fix this?

Thank you for the support

At the end I checked all the tags and everything seems ok so I reboot the gateway server and the alarms in the log disappear.

The error, for posterity, was this. Entirely on the MSSQL side of things; this means your DB was connected, and the server was explicitly rejecting Ignition trying to create tables.

Thanks for the answer, ok this but I don't understand why since the moment I change the database provider to the correct one I had that alarm every minute until I reboot the server.