Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I can use SCOPE_IDENTITY() with INSTEAD OF INSERT on a v
Message
De
11/06/2003 13:59:17
 
 
À
11/06/2003 12:09:07
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00798811
Message ID:
00799051
Vues:
50
Hi Michael,

I don't have problem into the trigger, i want identity out of the trigger.

If TRIGGER is FOR (AFTER) type, SCOPE_IDENTITY() return id insert on the table where i exec INSERT, but if i define a INSTEAD trigger, SCOPE_IDENTITY() return NULL.

Example:

-- Batch
INSERT INTO tableWithInsteadInsertTrigger VALUES (....) -- Note*
SELECT SCOPE_IDENTITY() -- this return NULL
Note*. This fired a INSTEAD OF INSERT trigger, and on this a INSERT command is done (within INSTEAD SCOPE_IDENTITY is ok )

Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform