newbie question....


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: newbie question....

  1. #1
    Matt Markus Guest

    newbie question....

    I want to write a stored procedure that inserts a record into a table and
    return the ID of the newly created record.

    Example:

    CREATE PROCEDURE SetStatus
    AS

    Insert Into Status(Success) Values(1)

    'here I want to return the new ID that was created when the above statement
    executed

    Thanks!



  2. #2
    Matt Markus Guest

    Re: newbie question....

    Never mind - figured it out

    "Matt Markus" <matt_markus@hotmail.com> wrote in message
    news:3ca8d54e@10.1.10.29...
    > I want to write a stored procedure that inserts a record into a table and
    > return the ID of the newly created record.
    >
    > Example:
    >
    > CREATE PROCEDURE SetStatus
    > AS
    >
    > Insert Into Status(Success) Values(1)
    >
    > 'here I want to return the new ID that was created when the above

    statement
    > executed
    >
    > Thanks!
    >
    >




  3. #3
    Michael Tzoanos Guest

    Re: newbie question....


    Hope you used @@Identity to return as an output parameter

    "Matt Markus" <matt_markus@hotmail.com> wrote:
    >Never mind - figured it out
    >
    >"Matt Markus" <matt_markus@hotmail.com> wrote in message
    >news:3ca8d54e@10.1.10.29...
    >> I want to write a stored procedure that inserts a record into a table

    and
    >> return the ID of the newly created record.
    >>
    >> Example:
    >>
    >> CREATE PROCEDURE SetStatus
    >> AS
    >>
    >> Insert Into Status(Success) Values(1)
    >>
    >> 'here I want to return the new ID that was created when the above

    >statement
    >> executed
    >>
    >> Thanks!
    >>
    >>

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center