[snip] If you have a query in your PHP code, which you are going to be executing a lot, even if you are using prepared statements, you can go one further by creating a stored procedure. Now the SQL server will only ever need to compile the statement once. No matter how many times it is used. You only need to supply the data which will be type appropriate. [/snip] I second this, using stored procedures has a lot of advantages. If you need to change your SQL you can do it in one spot. It reinforces MVS or modular coding behavior, the SP becomes very re-usable. Security is improved. Performance can be improved. You can put the bulk of the data handling on the database where it really belongs because SP's can perform complex operations complete with control structures. Lastly it simplifies your PHP code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php