Re: Related table entries deleted when I deleted a table. Why?

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

From: Larry Woods (larry_at_lwoods.com)
Date: 11/24/04


Date: Wed, 24 Nov 2004 05:00:10 -0700

I used a "DELETE" statement in Query Analyzer. I can't (or WON'T) recreate
this because it is a production server. And the problem wasn't discovered
for some time so backups are questionable. I have checked a backup database
on a test system that has a copy of the production database and there are no
"Cascading" options set in these tables either.

Strange...

Larry Woods

"Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> wrote in
message news:eeCyOAX0EHA.3072@TK2MSFTNGP11.phx.gbl...
> Did you delete the table (DROP TABLE) or deleted all rows from the table?
In any case, this
> shouldn't happen. You cannot drop a table to which you have references.
And you cannot remove a row
> for which you have referencing row (if you don't have cascade).
>
> How did you do the operation? Query Analyzer? Enterprise Manager? Some
other application? Can you
> reproduce this?
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "Larry Woods" <larry@NOSPAMlwoods.com> wrote in message
> news:OMqcu3W0EHA.4004@tk2msftngp13.phx.gbl...
> > I deleted a table and it looks like ALL table entries from a related
table
> > that were deleted. I checked the relation that was defined in the
deleted
> > table and the "Cascading Update Related Fields" and "Cascade Delete
Related
> > Records" were NOT checked. "Enforce relationship for INSERT's and
UPDATES
> > WAS checked, as well as "Enforce relationship for replication." were
> > checked.
> >
> > Should the related table records have been deleted?
> >
> > TIA,
> >
> > Larry Woods
> >
> >
>
>



Relevant Pages

  • Re: How do I unload/replace dll without stopping server?
    ... Larry Woods wrote: ... > replace it on a production server, but I don't want to stop/restart ... > server in order to replace the dll. ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • Re: What does Cut do?
    ... Regard to your question, by mistake, I used Cut instead of Copy in a ... production server and I thought that I had deleted the table. ... How often do you open Enterprise Manager to look at tables, ... > less mystical tool that combines the features of EM and Query Analyzer). ...
    (microsoft.public.sqlserver.server)
  • Re: How do I unload/replace dll without stopping server?
    ... Larry Woods wrote: ... > replace it on a production server, but I don't want to stop/restart server ... > in order to replace the dll. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Need to make Sort ORDER in SP defined by Input variable
    ... Just checked using Query Analyzer. ... > TIA, ... > Larry Woods ...
    (microsoft.public.sqlserver.programming)