Tuesday, March 27, 2012

Deleting records

How do I delete one record from one table and cascade down all related tables?
Mike BKBA1 (http://support.microsoft.com/default.aspx?scid=kb;en-us;825021) & KBA2 (http://support.microsoft.com/?scid=kb;en-us;Q142480) to highlight issue if any trigger is involved.

This one too http://www.sqlteam.com/item.asp?ItemID=8595
HTH|||Establish cascading deletes between your tables, or use a trigger.|||Thanks for the replies guys, but apparently, I just have to learn patience. I am getting SQL Server 2000 at the end of the month and this supports Cascading DRI :).

Mike B|||Gotta be the same Mike

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=33023

What about performance though..being "old school", I do it the old fashion way...|||What version are you using now? Hasn't cascading been a feature since at least 7.0, if not 6.5?|||Yeah...but you gotta remeber there's more than one platform...

DB2 OS/390, Oracle, SQL Server...oye

changing gears can get REAL interesting sometimes...

I guess I'm just from the school that here is no such thing as a key change...it's a new element...

and cascading deletes? I would imagine, is like giving a gun to a 2 year old for most developers...

no?

"OH SH-T, It's a MIRACLE! ALL THE DATA IS GONE!"

:eek:

Hey...triggers is hard enough for them to understand...

"Why are there 2 Rows affected?"|||Yeah, but my policy is not to design databases or write code for the lowest common denominator. If a business is too cheap to hire a competent DBA or Developer who can understand what I've built, then they deserve to have problems.|||Originally posted by blindman
What version are you using now? Hasn't cascading been a feature since at least 7.0, if not 6.5?
Update and Insert yes, not deleting

Mike B|||Originally posted by blindman
What version are you using now? Hasn't cascading been a feature since at least 7.0, if not 6.5?
6.5 never had it, neither did 7.0|||Fully agree,

As a developer I would never touch an application until I understood the data model and business rules defining it.

I find that triggered deletes too often get overlooked by developers, more so than the expectation that deletes WILL cascade throughout the data model.

Nothing worse than orphaned entries when trying to troubleshoot data errors.
Originally posted by MikeB_2k4
Update and Insert yes, not deleting

Mike B|||Originally posted by Brett Kaiser
Yeah...but you gotta remeber there's more than one platform...

DB2 OS/390, Oracle, SQL Server...oye

changing gears can get REAL interesting sometimes...

I guess I'm just from the school that here is no such thing as a key change...it's a new element...

and cascading deletes? I would imagine, is like giving a gun to a 2 year old for most developers...

no?

"OH SH-T, It's a MIRACLE! ALL THE DATA IS GONE!"

:eek:

Hey...triggers is hard enough for them to understand...

"Why are there 2 Rows affected?"

Extremely valid points!! (and yes it is the same Mike :) ) I am not sure if I even want to provide the deletion capability, but that doesn't mean I don't have to know how to do it.

Mike|||Originally posted by blindman
Yeah, but my policy is not to design databases or write code for the lowest common denominator. If a business is too cheap to hire a competent DBA or Developer who can understand what I've built, then they deserve to have problems.

What's the largest group you ever worked with?

And you know...it's always the database that's at fault...

Until you waste the time and prove them wrong (again)|||Yeah, and when you do, - they'll gang up on you and wait till it's really the database, and then you'll never hear the end of it... Hate them, hate them all!!!|||We have about 3K of them here, and only 5 of us...well, 2, if you count real bodies ;)|||Originally posted by rdjabarov
We have about 3K of them here, and only 5 of us...well, 2, if you count real bodies ;)

3,000? On a project level?

Or are you glass house support?|||Honestly, I don't know what 4/5 of them are here for, a mistery to me. But when on-call, I still have to be polite with them...at 3AM...when they trashed something, or when they can't connect and ask me to run a Profiler for them (that's the extent of their troubleshooting skills)|||I'll always remember getting an emergency call from the help desk once because a critical user couldn't get into the database. So I check the DB and everything is fine, and then I hustle down to her cube and find out that she has not electrical power to her station.

...but the case was a database issue because she couldn't get into her database... :rolleyes:|||You should embelish taht and send it in to the shark tank...|||Shark tank ?

-PatP|||oooh yeah...

You got to sign up and get the daily shark tank mailed to you...

http://www.computerworld.com/departments/opinions/sharktank?from=left|||I am firmly convinced that some of our vendors give their help-desk techs this as their script:

1) Are you sure the power cord is plugged in?
2) Have you applied the latest service pack?
3) Can you send us a copy of your database?

Hmm. Let's see. I have an application that works from one client, but does not work from another. Yeah, I can see as that is a database problem. Wait here, while I go get my troubleshooting baseball bat. ;-)|||That's not just any troubleshooting baseball bat...

It's a troubleshooting saux baseball bat!

And then there's April 16th in beantown! 8:05 prime time, national tv!

Maybe a ride up to visit the sister in law...

At least get a seat at the cask n' flaggon..

Still there?|||It's still there.

http://boston.citysearch.com/profile/4771681/

Who the heck runs this place? A Yankees fan?

Excerpt:

...and when the memories get too depressing, you can get a drink at the huge wraparound bar ....

Probably the most profitable bar in Boston ;-).|||I'm sitting here cracking up...and that doesn't look the flaggon I remeber...it was a dump...but then again it was late and I was hammered...

Is it still next to fenway?

EDIT: Or I could just click on the map...yup still there...

Another must visit place when I'm up is the beer works..well actually all the breweries...need new t shirts...

No comments:

Post a Comment