Where do I place a stored procedure?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uicouic
    New Member
    • Jan 2009
    • 24

    Where do I place a stored procedure?

    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.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    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

    Comment

    • uicouic
      New Member
      • Jan 2009
      • 24

      #3
      Oh ok I'll take that in mind.

      Thanks ck9663.

      Cheers! :)

      Comment

      Working...