I experienced something that is probably correct, but I didn’t expect it. I need to understand what’s going on.
I was running a series of batch queries (I was reading from some SQL files) and writing to a different databse that is in my connection properties. Basically, my query looked like this:
system.db.runQpdateQuery(" BEGIN TRANSACTION USE Archives SET IDENTITY_INSERT dbo.Parts ON blah, blah, blah, COMMIT")
This went fine. But, the next time I started the designer all of the queries in my bindings failed and everything was red, obviously because I was still “using” the database in the batch query. I restarted the designer again, but with the same results. All I could do to get out of it was to make a temporary button that ran a short query to “USE MyNormalDatabase” and all was good again.
Does this seem right, that the gateway continued to use the database from the batch query even after I restarted the designer? What would I expect to see if one of the clients were to run a similar query- would it affect the others? Is there a better way to do this that is more Ignition-esque?