Stored procedures conceptually:


  • A stored procedure is a collection and set of sql statements and sql command logic which is compiled and stored in the database. A stored procedure is one kind of database object which is available under programmability section.
  • These are called the named blocks in TSQL.


Advantage of using Stored Procedure:

Reusability: It helps in re usability of the SQL code because it can be used by multiple users and by multiple clients since we need to just call the stored procedure instead of writing the same SQL statement every time. It helps in reducing the development time.

Function based access to tables: A user can have permissions to execute a stored procedure without having permission to operate directly on the underlying tables.

Reduced network traffic: Stored procedures can consists of many individual SQL queries but can be executed with a single statement. This allows us to reduce the number and size of calls from the client to server.

Faster Execution: SP query plan are kept in memory after the first execution. The code doesn't have to be reparsed and repotimized on subsequent executions.

Stored procedure can accepts input and output parameters. Stored procedure can returns multiple values using output parameters. Using stored procedure, we can Select,Insert,Update,Delete data in database.


Comments

Popular posts from this blog