Re: Deleting Multiple Rows

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Joe Celko (jcelko212_at_earthlink.net)
Date: 08/16/04


Date: Mon, 16 Aug 2004 15:02:20 -0700


>> The logic that determines which rows to delete has to stay in the
application (can't realistically be moved to the db). <<

Why? The only reason I can come up with is that a human being or
external agent is making unpredictable numbers as they go along. If
there was an algorithm, then you ought to be able to put it in the WHERE
clause of a DELETE FROM statement.

>> Too bad there's not an easy way to pass a varchar variable
(containing a delimited list of the ints) to the WHERE clause of the
DELETE statement... <<

There are a bunch of such kludges posted here. They are all dangerous
and slow thanks to dynamic SQL.

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Which anime characters would you NOT want to wake up in bed with?
    ... if sober" clause, not on the "oh shit I'm gonna die" clause, because I ... Same reason as above, and also because I'd ... Because my mind would COMPLETELY ... S'LITTLES: Feel the loli. ...
    (rec.arts.anime.misc)
  • Re: Clause order in SQL select query
    ... Rather than concatenate a bunch of string variables, ... '- since the FROM clause is parsed before the SELECT ...
    (microsoft.public.access.queries)
  • Re: UPDATE using params, again, deosnt work
    ... If those values are correct and the where clause value is ... I just mention this b/c this is very weird and it's getting weirder. ... Sending an update command is standard far and there's no reason that it ... did you run the Select statement beforehand? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Enforcing Christian values on others?
    ... termination no matter what the reason. ... That would be covered under a different clause: ... You will be given notification and you will be ...
    (uk.religion.christian)
  • Re: I need some help from native speakers of Japanese
    ... Now, there is a constraint in English Wh-question formation, to the ... clause, be it causal, concessive or otherwise, cannot be moved out of ... "Is the fact, that he went somewher, the reason, that you think so?", ...
    (sci.lang.japan)