Run Store Procedure multiple Times With Different parameter


To run Run Store Procedure multiple Times With Different parameter we have To pass dynamic parameter with store procedure

As the parameter  the value will also change .

Lets see eg.


 Create Procedure SP_UpdateRecord --10,2
  (
  @numericvalue1 int,
  @numericvalue2 int
  )
  As
  Begin

  select (@numericvalue1-@numericvalue2) as SubtractionResult,
  (@numericvalue1+@numericvalue2) as AdditionResult,
  (@numericvalue1*@numericvalue2) as  MultiplicationResult,
  (@numericvalue1/@numericvalue2) as  DivisonResult

   end


As the value Change In parameter the result will also Change Accordingly.Here we can use any dynamic value to fetch the result in the addition ,subtraction ,multiplication and division form.

No comments:

Post a Comment