Click here to Skip to main content
15,846,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How Can update and delete multiple data in single Stored Procedure
Posted

SQL
CREATE PROCEDURE MyProc
(
@Param1 int,
@Param2 varchar(100)
)
AS
BEGIN

    INSERT INTO Table1 (Col1, Col2)
    VALUES @Param1, @Param2

    UPDATE Table2
    SET Col2 = @Param2 
    WHERE Col1 = @Param1

END
 
Share this answer
 
Your Requirement is not very clear to me may be most of us.
Generally in a stored procedure you can write multiple
SQL
select,insert,Update Query.


For your reference check this
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900