Skip to content
Loading
  • Laxmidhar Sahoo
    0
    Hi I sent the details
     
    step 1 - Create a table with the below code
     
    create table test2
    (
    ID int identity(1,1),
    Salary decimal(18,2) null,
    Ecode varchar(50) null
    )
     
    step 2 - create send table with the below code
     
    create table test2
    (
    ID int identity(1,1),
    Salary decimal(18,2) null,
    Ecode varchar(50) null
    )
     
    step 3 - create a procedure with the below code
     
    create procedure Insert_tables
    (
    @Ename varchar(50),
    @Ecode varchar(50),
    @salary decimal(18,2)
    )
    as
    Begin
    begin try
    Insert into test1(Ename,Ecode)values(@Ename,@Ecode);
    Insert into Test2(Salary,ECode)values(@salary,@Ecode);
    End try
    Begin Catch
    -- your message should return in out put parameter
    end catch
    End
     
    step 4 - Execute the procedure with the below code
     
    Exec Insert_tables 'abc','C001',5000.00
     
    step 5- select query is given below
     
    select * from test1
    select * from test2
     
    0