Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a value
Message
 
 
À
16/10/2009 11:00:01
Gil Munk
The Scarborough Group, Inc.
Baltimore, Maryland, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01429636
Message ID:
01429662
Vues:
51
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform