-
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!
-
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!
>
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks