SELECT Stored Procedure - Select Stored Procedures in SQL Server



SELECT Stored Procedure

  • ALTER PROCEDURE using SELECT

Demo wikitechydatabase

  • Below is a selection from the wikitechytable table used in the examples:
select-procedure-table

Example

  • ALTER PROCEDURE using SELECT
ALTER PROCEDURE GetDataSP
(
@id INTEGER
@name VARCHAR(10),
@course VARCHAR(10),
@fees INTEGER,
@StatementType NVARCHAR(20) = ''
)
AS
BEGIN
  BEGIN
      IF @StatementType = 'Select'
          SELECT *
          FROM wikitechytable
  END
END

Output

select-stored-procedure

Execute PROCEDURE using SELECT

EXEC GetDataSP @id=10, @name='Venkat', @course = 'flutter' , @fees=150, @StatementType = 'Select';

Output

call-select-stored-procedure

Related Searches to SELECT Stored Procedure - Select Stored Procedures in SQL Server