Insert a record and return Auto generated Primary key of the table using Stored procedure?
CREATE PROCEDURE [SampleReturnID]
(
@EmployeeName varchar(50),
@id int output
)
AS
BEGIN
INSERT INTO Sample(Name ) VALUES (@EmployeeName )
SET @id=SCOPE_IDENTITY()
RETURN @id
END
(
@EmployeeName varchar(50),
@id int output
)
AS
BEGIN
INSERT INTO Sample(Name ) VALUES (@EmployeeName )
SET @id=SCOPE_IDENTITY()
RETURN @id
END
Comments
Post a Comment