sql server 2005 - Is it.. Good / Bad / Okay ... to use IF/While Conditions in Stored Procedures? -


My primary concern is with SQL Server 2005 ... I went through many websites and tells each other something different

To use the scenario which is good / OK .. For example it also hurts to determine the variable value inside or if only I run a query in my SP thinking input parameters Based on a number of situations, a dynamic SQL Is it me, do I need to think again about the query ... depending on the SP, what different query runs, depending on whether some records exist in the table. etc etc. My question is not limited to these scenarios ... I am looking for a slightly more generalized answer so that I can improve my future spouses

In short ... branches Which statement is useful in the situation / loop, which is bad and which is fine.

Generally ... Avoid procedural codes in your database, and paste it from the query by query optimizer An opportunity to improve your work

The exception will be a code that is designed to do many things instead of determining the results, and when a query results faster in the rows Will need to join


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -