Maybe in the next ten years, Rockwell will get the hint and provide SQL connections on their PLCs.
But, I kind of understand why they don’t offer it.
If the query does not need to be dynamic or you are only writing a few values to SQL server, it makes sense to just handle it on the PLC.
Otherwise, if you need many queries that may need to change over time, need the ability to add more queries, or are writing a lot of values to SQL server. Then it is best done in a middleware application. Granted, more queries generally means a change in tag structure.
Executing a stored procedure on a plc is also a good example for doing it. Allows some customization on the sql side without needing to update the plc code. Unless it’s a major change.