How to use insertion and deletion of row using stored procedure.
try operational stored procedure.
You have to declare variable
Now you can execute perticular query with just passing
You can put both query in one operation as you wish.
You can execute multiple operations with this query....
You have to declare variable
@operation
with int
datatype like as shown below,Now you can execute perticular query with just passing
@operation
from backend.You can put both query in one operation as you wish.
You can execute multiple operations with this query....
CREATE PROCEDURE SP_MyQuery
@ItemCode VARCHAR(50)=''
,@ItemDescription VARCHAR(250)=''
,@ItemCategoryID INT=0
,@ItemID INT=0
,@operation int=0
AS
BEGIN
IF(@operation=1)
begin
--What ever you want to execute, insert query , update query , delete query, select query
end
ELSE IF(@operation-2)
BEGIN
--What ever you want to execute, insert query , update query , delete query, select query
END
END
No comments :
Post a Comment