>Hi,
>Just to let you know: I am new to SQL Server.
>I need to return the identity value for either a new record or updated record in a table. What my return parameter returns is a 1 - presumably the number of records found and not the value of iid. What am I doing wrong?
>
>Here is my Stored Procedure:
>
>
<snip>
Gil,
1. You return your parameter as Output, don't add it as RETURN also
2. Instead of doing an extra select, you can use set @PmIID = SCOPE_IDENTITY()
Finally, please read up links from
http://forums.asp.net/p/1481883/3461486.aspx#3461486
If it's not broken, fix it until it is.
My Blog