Database/MySQL

프로시저 언제 사용해야 하나?

상쾌한기분 2019. 10. 22. 16:59
반응형

The benefits of using stored procedures in SQL Server rather than application code stored locally on client computers include:

  1. They allow modular programming.

  2. They allow faster execution.

  3. They can reduce network traffic.

  4. 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. 

 

728x90
반응형