Database

Topic: SQL

what are advantages and Disadvantages of Stored Procedure

Advantages of stored procedures:the procedures/functions are stored in the database and are, therefore, executed on the database server which is likely to me more powerful than the clients which in turn means that stored procedures should run faster;the code is stored in a pre-compiled form which means that it is syntactically valid and does not need to be compiled at run-time, thereby saving resources;each user of the stored procedure/function will use exactly the same form of queries which means the queries are reused thereby reducing the parsing overhead and improving the scalability of applications;as the procedures/functions are stored in the database there is no need to transfer the code from the clients to the database server or to transfer intermediate results from the server to the clients. This results in much less network traffic and again improves scalability;when using PL/SQL packages, as soon as one object in the package is accessed, the whole package is loaded into memory which makes subsequent access to objects in the package much fasterstored procedures/functions can be compiled into “native” machine code making them even faster (available with Oracle 9i and above)Disadvantages:there is an overhead involved in switching from SQL to PL/SQL, this may be significant in terms of performance but usually this overhead is outweighed by performance advantages of using PL/SQLmore memory may be required when using packages as the whole package is loaded into memory as soon as any object in the package is accessednative compilation can take twice as long as normal compilationDespite the advantages listed above, there are some situations where the use of stored procedures is not recommended or may be infeasible.Disadvantages    Applications that involve extensive business logic and processing could place an excessive load on the server if the logic was implemented entirely in stored procedures. Examples of this type of processing include data transfers, data traversals, data transformations and intensive computational operations. You should move this type of processing to business process or data access logic components, which are a more scalable resource than your database server.    Do not put all of your business logic into stored procedures. Maintenance and the agility of your application becomes an issue when you must modify business logic in T-SQL. For example, ISV applications that support multiple RDBMS should not need to maintain separate stored procedures for each system.    Writing and maintaining stored procedures is most often a specialized skill set that not all developers possess. This situation may introduce bottlenecks in the project development schedule.

Browse random answers:

Define SQL?
Define Dbms?
What is the purpose of Database systems?
State the different between Security and Integrity?
Define Normalisation?
What are the purpose of Normalisation?
Define Primary Key?
Define Unique Key?
Define Foreign Key?
Define View?
Compare and contrast TRUNCATE and DELETE for a table?
What is cursors?
Define SubQuery?
What are the different types of subquery?
What are the different types of replication?
What is User Defined Functions?
Define Self Join?
Define Sequence?
Define Joins?
What is a JOIN? Explain types of JOIN in oracle.
What are the types of Joins?
Define Equi Joins?
Define Cartesian Join?
What are three SQL keywords used to change or set someone's permissions?
What are primary keys and foreign keys? 
Define data model?
What is an Entity?
What is BCP? When does it used?
Explain the use of the by GROUP BY and the HAVING clause?
What is DataWarehousing?
What are advantages of Using Oracle
What are the advantages of Database?
What are the advantage of SQL?
What is the difference between join and outer join?
what is  Boyce coded normal form in oracle?
Define Boyce coded normal form?
What are the transaction properties?
What is data mining?
Compare DBMS versus object oriented DBMS?
What are the types of SQL Commands?
What is an attribute?
What are the different types of data models?
What is an active database?
What are ACID properties?
Description of the properties
ACID stands for Atomicity 
Consistency 
Isolation 
Durability
Define Self Join?
What is a tuple?
What is SQL ?
What is meant by embedded SQL?
What is Functional Dependency?
What are the different phases of transaction?
What the difference between UNION and UNIONALL?
What is diffrence between Co-related sub query and nested sub query?
What is DBCC? 
What is the use of DBCC commands?
What is a Linked Server?
What is Collation?
What are different type of Collation Sensitivity?
What is the difference between a primary key and a unique key?
What is the difference between Function and Stored Procedure?
What command do we use to rename a db?
What command do we use to rename a db, a table and a column?
What is BCP?
What is Cross Join?
What is Storage Manager?
What are stored-procedures? And what are the advantages of using them?
what are advantages and Disadvantages of Stored Procedure
What is database Trigger?
What is trigger
What is OLTP?
Difference between OLTP and OLAP ?
What is DDL (Data Definition Language)?
What are the difference between DDL, DML and DCL commands?
What is Weak Entity set?
What is the difference between weak entity set & strong entity set ?
What is a deadlock?
What is Flat File?
What is database?
What does teh term upsizing refer to? 
What do you mean by flat file database?
What is difference between TRUNCATE & DELETE? 
What is Index?
What command is used to create a table by copying the structure of another table? 
What is the difference between clustered and a non-clustered index?
Examine this function 
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
Why is an event driven program referred to a passive program? 
What is log shipping?
What is the difference between file server and a database server? 
What are primary keys and foreign keys?
What is sql BREAK? 
What are check constraint?
What is sql JOIN? 
What are the type of Synonyms?
What is sql Consistency?
What is an Integrity Constrains?
Explain Order of SQL statement execution? 
What is Table?
What are the advantages of VIEW? 
What is Rollback Segment?