Can some explain this to me?
- From: davidaustinarcher@xxxxxxxxx
- Date: Thu, 25 Oct 2007 11:27:23 -0000
Hello,
I run the following query on a database (SQL 2005):
delete from person where pers_companyid in (select pers_companyid from
company where comp_expiry is not null)
I wanted to delete all people associated with a company which had an
expiry date. The mistake I made was that the column pers_companyid
does not exist. It should have been comp_companyid.
However, the query ran anyway and deleted all records from my person
table? If I run the subquery on its own then it doesn't run as the
column is missing.
Shouldn't I have got an error running this query?
Thanks,
David
.
- Follow-Ups:
- Re: Can some explain this to me?
- From: --CELKO--
- Re: Can some explain this to me?
- From: Roy Harvey (SQL Server MVP)
- Re: Can some explain this to me?
- Prev by Date: Re: design Index problem
- Next by Date: Re: Wrong result Set when using NoLock
- Previous by thread: Weird speed problem
- Next by thread: Re: Can some explain this to me?
- Index(es):
Relevant Pages
|