i have a project in c# code with 3 leyer; and all of database code are in data leyer, which method is better?
1- send sql string statementto data base for select or update?
2 - using stored procedure?

in databases with larg scale wich is better?
pleas help me?!

It really depends on what you are doing. If you are doing simple selects, deletes, updates, etc. then you won't notice much of a difference between the two. But, if you are doing lots of DB activity where the results from one call are used by other database calls (and you don't need the values somewhere else) then a stored procedure is going to give you better performance as you don't have the overhead of returning data to your program just to send it back to the database for more work.

When the stored procedure size is very large in pages, you could distribute the functionality easily with some of the processing coded in the application.

On the other hand, many developers write their entire database calls in application code. Obviously, it eliminates the database server completely without any use of processing power of database. But this creates a static code that must be updated as and when dynamic changes to database tables occur. So to avoid this, you must use stored procedures offloading processing from your application.

This article has been dead for over six months. Start a new discussion instead.