Does anyone know of a custom FoxPro procedure or regex that will automatically add brackets around all the table and field names in a SQL Select statement string?
For instance:
Select mach_name, mach_num, orderFrom Machines Whereorder< 100
Needs to become:
Select [mach_name], [mach_num], [order] From [Machines] Where [order] < 100
I also have Joins, Order By, and Group By clauses in some of the Select statements that I need to get cleaned up as well.
I'm trying to avoid adding brackets manually, because for a while the SQL statements still need to run against DBFs tables, so I if add them now, it will break the DBF version of the app. I know there are other VFP vs. Sql Server issues that I must address, but this is the biggest one I am facing now.