Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO 2.0 and SQL Server
Message
De
26/01/1999 02:44:42
 
 
À
20/01/1999 20:13:37
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00178333
Message ID:
00180171
Vues:
20
This is very easy in fact, using SQL. Indeed, take a look at the following code:

DECLARE @li_Index INTEGER

INSERT INTO tab_MyTable
   (Field_1,
    Field_2)
VALUES
   (@Field_1,
    @Field_2)

SELECT @li_Index = @@IDENTITY

Now the SQL variable @li_Index value is set to the identity value used to insert the record into the table tab_MyTable. In fact, the SQL global variable @@IDENTITY always contains the last inserted identity for the session (do not be afraid of concurrent accesses).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform