Re: Store procedure vs Direct statement ???
- From: "Marina Levit [MVP]" <someone@xxxxxxxxxx>
- Date: Wed, 29 Mar 2006 16:26:25 -0500
Stored procedure do have a security advantage.
Let's say you have a stored procedure called InsertCustomer, that takes some
parameters, and adds a customer. Ok, great. You can have a sql account that
has access to this stored procedure, but nothing else.
If you instead allow your app to do dynamic sql, then your sql account needs
rights to the Customer table. As soon as someone gets access to your
application and can alter the sql or something like that, they can now do
anything to the Customer table that they want - like delete all customers,
etc.
So, in this sense a stored procedure is more secure.
"Kerry Moorman" <KerryMoorman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1C52B90F-571C-4004-9DA7-0FCF8F6263ED@xxxxxxxxxxxxxxxx
Serge,
All sql is executed on the server, so stored procedures don't have any
security advantage over dynamic sql in that instance.
If you use parameters in your dynamic sql then you will gain the same
security benefits as using a stored procedure in terms of sql injection.
I think the decision is one of design philosopy as opposed to security or
performance.
Kerry Moorman
"serge calderara" wrote:
Dear all,
Is there any restriction or rules when you must you Store procedure call
within application code compare to direct SQL statement.
For sure the first reason is data security as all querry are executed on
the
server.
But is there some cases where store procedure should be avoid ?
For my case if data security is a must, the first thing would be to
always
use strore procedure
Any comments are welcome
Regards
Serge
.
- Follow-Ups:
- Re: Store procedure vs Direct statement ???
- From: Frans Bouma [C# MVP]
- Re: Store procedure vs Direct statement ???
- From: Kerry Moorman
- Re: Store procedure vs Direct statement ???
- Prev by Date: Threads and Transaction Problems....
- Next by Date: Re: Store procedure vs Direct statement ???
- Previous by thread: Re: Store procedure vs Direct statement ???
- Next by thread: Re: Store procedure vs Direct statement ???
- Index(es):
Relevant Pages
|