Professional Documents
Culture Documents
TSQL, SPs
TSQL, SPs
Transact SQL deals with set of statements that are grouped in the form of a block
and submitted at
server at once for execution.
-->SQL is a NON PROCEDURAL LANGUAGE since it deals with WHAT data to be extracted.
-->T-SQL is a PROCEDURAL LANGUAGE, it deals with WHAT Data to be extracted and HOW
it should be displayed.
SP:
Types
1.Predefined SP--SP_help,SP_helptext,SP_Refresh etc
2.User Defined SP---It can be Created User
3.CLR SP
Disavantage
-->Tesing
-->Debugging
-->Vesioning
-->Cost is high--Need to expert developers
-->High portability
Syntax:
---Execution
---Drop
drop procedure USP_name
/**
Created By: Prasad
Created Date:12-08-2021
Description: we get the employee details
Modified SP:
Modified Date:
exec USP_EmployeeDetails
**/
Alter Proc USP_EmployeeDetails
As
Begin
select * From EMP
End
/**
Created By: Prasad
Created Date:12-08-2021
Description: we get the employee details
Modified SP:
Modified Date:
exec USP_EmployeeDetails
**/
CREATE Proc USP_EmployeeDetails
As
Begin
select * From EMP
End
End
End
select @C as Multiplication
End
declare @C int
Set @C=@A+@B
Return @C
End
/**
declare @C int
exec @C=USP_ReturnValue 10,20
select @C
***/
End
/**
Declare @C int
Exec USP_OutputKeyword 333,7487 ,@C output
select @c
**/
5.Call SP in another SP
End
/***
**/