X

Download Store Procedure and Function in Sql Server PowerPoint Presentation


Login   OR  Register
Home / Education & Training / Education & Training Presentations / Store Procedure and Function in Sql Server PowerPoint Presentation

Store Procedure and Function in Sql Server PowerPoint Presentation

               
Note : Store Procedure and Function in Sql Server PPT Presentation is available for free download. Click on Download Free PowerPoint Presentation top red button for free download Store Procedure and Function in Sql Server presentation in .ppt/pptx format.
programmingsguru By : programmingsguru

On : Jul 18, 2014

facebook   twitter   google plus  
In : Education & Training

Embed :
709
views

1
downloads
Login / Signup - with account for


  • → Make favorite
  • → Flag as inappropriate
  • → Download Presentation
  • → Share Presentation

Store Procedure and Function in Sql Server
Presentation Transcript
Collapse/Expand

  • Slide 1 - Store Procedure and Function in SQL Server
  • Slide 2 - Stored Procedure : - Stored Procedure In Sql server can be defined as the set of logically group of Transact-SQL statements which are grouped to perform a specific task.
  • Slide 3 - There are many benefits of using a stored procedure. The main benefit of using a stored procedure is that it increases the performance of the database. The other benefits of Store procedure are below : - Stored procedure will reduce network traffic and increase the performance. Compilation step is required only once when the stored procedure is created. It helps in re usability of the sql code. Stored procedure is helpful in enhancing the security, provide security by sql-injection. If we modify stored procedure all the clients will get the updated stored procedure
  • Slide 4 - There are two main types of stored procedure – System stored procedures and User-defined stored procedures. System stored procedures : SQL Server, many administrative and informational activities can be performed by using system stored procedures. Every time we add or modify a table, make a backup plan, or perform any other administrative function from within Enterprise Manager, we actually call a stored procedure specifically written to complete the desired action. These stored procedures are known as system stored procedures. eg: sp_helptext [StoredProcedure_Name] , sp_help etc.
  • Slide 5 - User-defined stored procedures : A user stored procedure is any program that is stored and compiled within SQL Server (but not in the master database) . While coding these procedures don’t use sp_ prefix because if we use the sp_ prefix first it will check master database then it comes to user defined database. another type of store procedure is Extended Stored Procedures : Extended stored procedures are the procedures that call functions from DLL files.
  • Slide 6 - Syntax of store procedure : Create Procedure Procedure-name ( Input parameters , Output Parameters (If required) ) As BEGIN Sql statement or required statement END
  • Slide 7 - Function is a database object in Sql Server. Basically it is a set of sql statements that accepts only input parameters, perform actions and return the result. Function can return only single value or a table. We can’t use function to Insert, Update, Delete records in the database table(s).
  • Slide 8 - Types of Function System Defined Function : System Defined Function are defined by Sql Server for different purpose. Scalar Function : rand, upper, lower, ltrim etc. Aggregate Function : max , min , avg , count
  • Slide 9 - User Defined Function : These functions are created by user in system database or in user defined database. User defined scalar function also returns single value as a result of actions perform by function. User defined inline table-valued function returns a table variable as a result of actions perform by function. User defined multi-statement table-valued function returns a table variable as a result of actions perform by function.
  • Slide 10 - Create function fnEmpFullName ( @FName varchar(50), @LName varchar(50) ) returns varchar(101) As Begin return (Select @FName + ' '+ @LName); end Select dbo.fnEmpFullName(FirstName,LastName) as Name from Employee
  • Slide 11 - Create function fnGetEmployee() returns Table As return (Select * from Employee) Select * from fnGetEmployee()
  • Slide 12 - Difference Between Store Procedure and Function
  • Slide 13 - Function must return a value but in Stored Procedure may return value Functions can have only input parameters but Procedures can have input/output parameters. Functions can be called from Procedure whereas Procedures cannot be called from Function. Procedure allows SELECT as well as DML statement but Function allows only SELECT statement in it. Function can be embedded in a SELECT statement but not in Procedures. In Procedure we can handle Exception by try-catch but not in Function. We can do Transaction Management in Procedure but not in Function.
  • Slide 14 -

    Happy Coding

Description : This store procedure and function powerpoint presentation collected about store procedure,about function, example of SP and UDF,difference between SP and UDF and more. I hope you will be find these explaination,examples and information about store procedure/function helpful for you.

Tags : sql server | store procedure | function | UDF | about UDF | procedure in sql | sql tutorial | about SP | sql database