adspace


Tell me what are the advantages of using stored procedures?

Answer Posted / Sharad Vishwakarma

Using stored procedures offers numerous benefits in SQL Server, including:n
1. Improved Performance: Stored procedures reduce network traffic and execution time by storing prepared execution plans.
2. Code Reusability: Stored procedures can be reused across multiple applications, reducing code duplication.
3. Enhanced Security: By restricting user access to stored procedure calls, you can better control and manage database security.
4. Error Handling: Custom error handling within stored procedures helps maintain application consistency.
5. Improved Query Optimization: The Query Optimizer can cache the execution plan for a stored procedure, improving performance over time.
6. Reduced Application Size: Stored procedures help decrease the overall size of applications by moving complex logic to the database server.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1215


Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

1024


what is the difference between openrowset and openquery?

1197


If any stored procedure is encrypted, then can we see its definition in activity monitor?

1073


What is the difference between upgrade and migration in sql server?

1185


Equi join and non equi join is possible with sql server?

1134


What are different types of constraints?

1003


Can we shrink data file in sql server?

1130


Can sql servers link to other servers like oracle?

919


What are the source of constraints?

1010


How do I find the sql server version?

1103


What is in place upgrade in sql server?

1127


Why should you use or avoid select * statements?

1111


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

2568


Can we do dml on views?

1039