Monday, 1 December 2014

Stored Procedure in Sql Server

-:Stored Procedure in Sql Server:-

  •  it is the group of precompiled sql statement 

  • precompile mean- When SP run first time then it can do compile and run both process but after that it can only run process.Not perform compile process

   Advantages:-

  • Maintainability
    • Because scripts are in one location, updates and tracking of dependencies based on schema changes becomes easier
  • Testing
    • Can be tested independent of the application
  • Isolation of Business Rules
    • Having Stored Procedures in one location means that there's no confusion of having business rules spread over potentially disparate code files in the application
  • Speed / Optimization
    • Stored procedures are cached on the server
    • Execution plans for the process are easily reviewable without having to run the application
  • Utilization of Set-based Processing
    • The power of SQL is its ability to quickly and efficiently perform set-based processing on large amounts of data; the coding equivalent is usually iterative looping, which is generally much slower
  • Security
    • Limit direct access to tables via defined roles in the database
    • Provide an "interface" to the underlying data structure so that all implementation and even the data itself is shielded.
    • Securing just the data and the code that accesses it is easier than applying that security within the application code itself
  • multiple usibility
  •  
  • complexivity decrease


  Disadvantage:-

  •  not debubing

  • poor exception handlind.


No comments:

Post a Comment