Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert trigger and batch updates
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Versions des environnements
SQL Server:
SQL Server 2000
Application:
Web
Divers
Thread ID:
01383018
Message ID:
01383126
Vues:
37
The AFTER triggers are to late for creating unique keys for multiple records because the constraints are processed before they are fired. You can submit some fake but unique values for the column in question in the INSERT command. They will be replaced anyway.

>Yes, this field is not used as my primary key (I always use IDENTITY surragate key) but is setup with unique constraint index. I'm not asking for a better way to setup the fields in the table (the requirement is what it is) but rather a solution to a specific problem I'm having with updating the value in this field inside a trigger when more than one record is inserted via a query. Thanks Sergey.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform