Store Procedure in Database

  • Update Stored Procedure

    ALTER PROCEDURE dbo.EMP_update
        @EMPNO Int,
        @ENAME varchar(50),
        @SAL Int,
        @COMM Int,
        @DEPTNO Int
    AS
        UPDATE EMP  SET
        ENAME=@ENAME,
        SAL=@SAL,
        COMM=@COMM,
        DEPTNO=@DEPTNO
        WHERE EMPNO=@EMPNO

    Insert Stored Procedure

    ALTER PROCEDURE EMP_insert
    (
    @empno    int,
    @ename    varchar(50),
    @sal    int,
    @comm    int,
    @deptno    int)
    as
    begin
    insert into emp
    (empno,ename,sal,comm,deptno)
    values(@empno,@ename,@sal,@comm,@deptno)
    end

    Delete Stored Procedure

    ALTER PROCEDURE dbo.EMP_delete
        @EMPNO Int
    AS
        DELETE EMP WHERE [EMPNO] = @EMPNO 





    ALTER PROCEDURE item_insert
    (
    @Itemcode int,
    @Category varchar(50),
    @ItemName varchar(50))
    as
    begin
    insert into item
    (Itemcode,Category,ItemName)
    values(@itemcode,@category,@itemname)
    end

    ALTER PROCEDURE item_update
    (
    @itemcode int,
    @Category varchar(50),
    @ItemName varchar(50))
    as
    begin
    update item set ItemName=@ItemName,Category=@Category where itemcode=@itemcode
    end

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week