Here is a very simplistic tutorial on how to make stored procedures in SQL SERVER. You can apply the same concept to most other RDBMS you want to use.
https://www.mssqltips.com/sqlservertutorial/168/different-options-for-creating-sql-server-stored-procedures/ If you do this you can stop writing SQL CODE in VFP and pass it to the backend where that db engine has to make a plan to execute the query every time. If you have that SQL Code in a stored procedure the db engine can look it its stats to determine the best plan to execute the code. I have some long stored procedures that are in the 3000 lines long arena that are called for every Bill of Lading report we print. Granted it combines Sales data, testing data, item specifications data as well as customer and our employee system data. This generates a CofA or Certificate of Analysis report for every lot number on the truck. Sprocs are great because they make it much harder to hack into your backend data. Nothing new here, right? https://www.xkcd.com/327/ -- Stephen Russell Sr. Analyst Ring Container Technology Oakland TN 901.246-0159 cell --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/cajidmykmoe_tgcd2pqjvqkbjcmbw_xbvd6g5e15jqu3qer7...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

