SQL Delete Stored Procedure - Delete Stored Procedure in SQL Server
DELETE Stored Procedure
- ALTER PROCEDURE using DELETE
Demo wikitechydatabase
- Below is a selection from the wikitechytable table used in the examples:
Example
- ALTER PROCEDURE using Delete
ALTER PROCEDURE GetDataSP ( @id INTEGER @StatementType NVARCHAR(20) = '' ) AS BEGIN BEGIN IF @StatementType = 'Delete' DELETE wikitechytable FROM WHERE id = @id END END
Output
Execute PROCEDURE using DELETE
EXEC GetDataSP @id=101, @StatementType = 'Delete' ;