Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value
Message
 
 
To
16/10/2009 11:00:01
Gil Munk
The Scarborough Group, Inc.
Baltimore, Maryland, United States
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01429636
Message ID:
01429662
Views:
52
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform