Monday, February 20, 2012

Get Identity column value after Inserting the record into Database Table

Create procedure [dbo].[SP_Insert_Employee]
@EmpId int output,
@Name nvarchar(50),
@Address nvarchar(50),
as
begin
insert into dbo.Employee(Name,Address) values(@Name,@Address )
set @EmpId=SCOPE_IDENTITY();
end

No comments:

Post a Comment