Click here to Skip to main content
15,890,438 members
Home / Discussions / Database
   

Database

 
GeneralStored procedure / query optimization Pin
Vagif Abilov28-Sep-04 7:47
professionalVagif Abilov28-Sep-04 7:47 
GeneralRe: Stored procedure / query optimization Pin
Steven Campbell28-Sep-04 8:19
Steven Campbell28-Sep-04 8:19 
GeneralRe: Stored procedure / query optimization Pin
Vagif Abilov28-Sep-04 8:52
professionalVagif Abilov28-Sep-04 8:52 
GeneralRe: Stored procedure / query optimization Pin
Steven Campbell28-Sep-04 9:48
Steven Campbell28-Sep-04 9:48 
GeneralRe: Stored procedure / query optimization Pin
Vagif Abilov28-Sep-04 9:55
professionalVagif Abilov28-Sep-04 9:55 
GeneralRe: Stored procedure / query optimization Pin
Colin Angus Mackay28-Sep-04 23:12
Colin Angus Mackay28-Sep-04 23:12 
GeneralRe: Stored procedure / query optimization Pin
Bill Dean29-Sep-04 6:31
Bill Dean29-Sep-04 6:31 
GeneralRe: Stored procedure / query optimization Pin
Steven Campbell29-Sep-04 8:30
Steven Campbell29-Sep-04 8:30 
Reducing the attack surface of your application is a good thing, but there are many other things I would recommend before getting to stored procedures:
* do not use sa to login
* encrypt your database connection string
* use parameterized queries

The efficiency/speed argument is bogus, especially considering murphy's law. In the time you'll take to finish the average 6 month project, processors will have improved enough to make the small "precompile" argument meaningless. The same could be said of many techniques for improving performance. Just let it go, and concentrate on creating a well structured application that is easy to maintain. Performance is a concern, but one more likely to be solved by a well placed index.

I'll admit that stored procedures are a useful abstraction for programmers that do not break down their applications into multiple well defined areas of responsibility. However, if you are in the habit of creating multi-tiered, well structured applications:
* SQL is in one place, or sometimes there is no SQL at all (O/R Mapping).
* Code is easily ported to different database platforms (again, the SQL is in one component that can be swapped out or regenerated)
* There is a layer of abstraction between the business code and the database already

I am content to let people use stored procedures if they want to. Most applications have bigger design problems than the decision whether to use stored procedures or not.


my blog
GeneralRe: Stored procedure / query optimization Pin
Colin Angus Mackay29-Sep-04 13:24
Colin Angus Mackay29-Sep-04 13:24 
GeneralRe: Stored procedure / query optimization Pin
Bill Dean30-Sep-04 2:21
Bill Dean30-Sep-04 2:21 
GeneralRe: Stored procedure / query optimization Pin
Jeremy Oldham29-Sep-04 13:50
Jeremy Oldham29-Sep-04 13:50 
GeneralRe: Stored procedure / query optimization Pin
Vagif Abilov29-Sep-04 19:40
professionalVagif Abilov29-Sep-04 19:40 
Generaleqivalent of "FOR UPDATE" Pin
WinDotNet27-Sep-04 19:35
WinDotNet27-Sep-04 19:35 
GeneralRe: eqivalent of "FOR UPDATE" Pin
Anonymous30-Sep-04 0:34
Anonymous30-Sep-04 0:34 
GeneralOracleClient StoredProcedure Pin
jzb27-Sep-04 17:01
jzb27-Sep-04 17:01 
QuestionAny way to optomize this? Pin
Jacob Hammack27-Sep-04 16:48
Jacob Hammack27-Sep-04 16:48 
AnswerRe: Any way to optomize this? Pin
Mike Ellison27-Sep-04 17:15
Mike Ellison27-Sep-04 17:15 
GeneralRe: Any way to optomize this? Pin
Jacob Hammack29-Sep-04 11:39
Jacob Hammack29-Sep-04 11:39 
AnswerRe: Any way to optomize this? Pin
Bill Dean29-Sep-04 6:50
Bill Dean29-Sep-04 6:50 
QuestionHow to position to row in DataTable or DataView Pin
magic4927-Sep-04 7:58
magic4927-Sep-04 7:58 
AnswerRe: How to position to row in DataTable or DataView Pin
Bill Dean29-Sep-04 7:01
Bill Dean29-Sep-04 7:01 
Generalsaving/retrieving image data in MSDE Pin
LongRange.Shooter27-Sep-04 7:40
LongRange.Shooter27-Sep-04 7:40 
GeneralPartial answer Pin
Steven Campbell27-Sep-04 8:30
Steven Campbell27-Sep-04 8:30 
GeneralRe: urgent can any help me ? Pin
Mike Ellison27-Sep-04 18:26
Mike Ellison27-Sep-04 18:26 
GeneralRe: urgent can any help me ? Pin
Colin Angus Mackay29-Sep-04 7:02
Colin Angus Mackay29-Sep-04 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.