Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2014-11-05 : 10:23:09
|
I have 4 tables"teamIDNAMETeamPropertiesIDTEAMIDNAMEteamRoleIDTEAMIDTEAMROLEIDroleCandidateIDROLEIDTeam is the main tableTeamProperties joins to the Team table by ID-TEAMIDroleCandidate joins to the teamRole table by TEAMROLEID-IDteamRole joins to the team table by TEAMID-IDI need to delete all reference in the TeamProperties, teamRole, roleCandidate and to these table that belong to a certain team. All I have is the ID for the Team table. Can't get my head wrapped around itDaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2014-11-05 : 16:58:10
|
Short answer: Delete from each table where TEAMID = YourValueLonger answer: Create foreign keys on each child table to the Team table that have a cascading delete defined. Delete from Team where TEAMID = YourValue. No amount of belief makes something a fact. -James Randi |
|
|
|
|
|