Jaya Prakash

Jaya Prakash

  • 508
  • 2.3k
  • 67k

Stored Procedure with identity column

Feb 16 2023 7:34 AM

This is my db

how to Write stored procedure for edit when im taking identity column pls help me 

create table mytable(id int identity(1,1),fname varchar(55),lname varchar(55),mobno bigint,Email varchar(100),salary money)

create procedure sp_GridData
as
begin
select * from mytable
end

create procedure sp_Insert
(
 @fname varchar(55),@lname varchar(55),@mobno bigint,@Email varchar(100),@salary money
)
as begin
insert into mytable values(@fname,@lname,@mobno,@Email,@salary)
end

create procedure sp_Edit
(
@fname varchar(55),@lname varchar(55),@mobno bigint,@Email varchar(100),@salary money
)
update mytable set fname=@fname,lname=@lname,mobno=@mobno,Email=@Email,salary=@salary   (Here How To Write Where Condition )

end

And also how to write sp for delete 


Answers (3)