Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Self Referencing DELETE Query Deletes All Rows
Message
De
20/08/2004 16:50:43
Jason Dalio
Northern Interior Regional Health Board
Prince George, Colombie Britannique, Canada
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00934181
Message ID:
00935049
Vues:
36
I realize that the LEFT OUTER JOIN will grab all of the records from the ClientAddressHistory table but I have included a WHERE clause that limits the list to those with a NULL value in the Enrollment table (verified by the initial SELECT statement that only returns a subset of the result set). Despite this, all records are being deleted from the table.

If I run just the select subquey contained in the delete transaction in retuns 0 rows. If I then change the DELETE statement to a SELECT statement and run the entire query it select 3 rows. So what i can't figure out is why it is deleting all rows based on a ClientID IN statement when the subquery returns only a subset of the ClientID values.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform