By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,843 Members | 2,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,843 IT Pros & Developers. It's quick & easy.

Where do I place a stored procedure?

P: 24
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,strToyCodeTO,) VALUES
(@strToyName,@strToyCode)
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.
Jan 17 '09 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Now that you have the SP, you have to create that inside your DB. How you will call it from your front-end depends on your application tool.

-- CK
Jan 18 '09 #2

P: 24
Oh ok I'll take that in mind.

Thanks ck9663.

Cheers! :)
Jan 19 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.