I made that once like this:
Create Procedure sp_myproc
@name as varchar(100)
as
begin
insert into table (name) values (@name)
select @@identity --assuming that id is identity
end
In your .Net code, you declare a commandType of scalar a get the return of
the stored procedure after execute it.
I hope this helps you.
"bic" <bi*@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
>I need to call a sp that inserts a row and returns the id. I take it that
I
have to use command vs. reader sqlcleint object to achieve this? How'd I
read the id back if the id is returded via a select at the end of the SP
vs.
thru a o/p parameter? Thanks.
--
bic