Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of records in DELETED?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01520791
Message ID:
01520792
Vues:
47
>Hi,
>
>When DELETE trigger is called, SQL Server creates table DELETED. I want to check that this table (DELETED) has only one record (in my business deleting more than one record indicates a problem). What is the syntax of checking for DELETED having only one record? Thank you.
if (select count(*) from Deleted) = 1
  -- We can proceed - only 1 record
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform