The benefits of using stored procedures in SQL Server rather than application code stored locally on client computers include:
-
They allow modular programming.
-
They allow faster execution.
-
They can reduce network traffic.
-
They can be used as a security mechanism.
Determine when to use stored procedures vs. SQL in the code
Stored procedures in SQL Server are similar to procedures in other programming languages in that they can:
-
Accept input parameters and return multiple values in the form of output parameters to the calling procedure or batch.
-
Contain programming statements that perform operations in the database, including calling other procedures.
-
Return a status value to a calling procedure or batch to indicate success or failure (and the reason for failure).
You can create a stored procedure once, store it in the database, and call it any number of times in your program. Someone who specializes in database programming may create stored procedures; this allows the application developer to concentrate on the code instead of SQL.
'Database > MySQL' 카테고리의 다른 글
데이터 베이스 설계 프로세스 (0) | 2019.10.22 |
---|---|
Isolation level (트랜잭션 고립(격리) 수준) (0) | 2019.10.22 |
MySQL's Storage Engines - InnoDB Engine (0) | 2019.10.22 |
트랜잭션 너는 누구니? (0) | 2019.10.22 |
MySQL's Storage Engies - MyISAM Engine (0) | 2019.10.22 |