Hello all. Sorry if the question is an obvious one, but I have a stored procedure as follows:
[CODE]
CREATE PROCEDURE USPAddToyRecord
@strToyName varchar(50) ,
@strToyCode varchar(6) ,
@intToyId int out
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO tblToy (strToyNameTO,s trToyCodeTO,) VALUES
(@strToyName,@s trToyCode)
SELECT @intToyId = @@IDENTITY
END
[CODE]
I am required to use it for adding a record into the database (SQL Server Express). When I enter the details such as name and code into the form and click "Save", the corresponding id of the record added would be displayed in a label.
Where do I place the stored procedure then and how do I achieve the function above? Any advice/help appreciated. Thanks.
[CODE]
CREATE PROCEDURE USPAddToyRecord
@strToyName varchar(50) ,
@strToyCode varchar(6) ,
@intToyId int out
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO tblToy (strToyNameTO,s trToyCodeTO,) VALUES
(@strToyName,@s trToyCode)
SELECT @intToyId = @@IDENTITY
END
[CODE]
I am required to use it for adding a record into the database (SQL Server Express). When I enter the details such as name and code into the form and click "Save", the corresponding id of the record added would be displayed in a label.
Where do I place the stored procedure then and how do I achieve the function above? Any advice/help appreciated. Thanks.
Comment