Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 11th, 2008, 08:24 AM
Authorized User
Join Date: May 2007
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to DarkForce
Default SQL Server 2005 Delete on cascade

Hi people,

i have serious problem with a delete statement.

The intension is to delete a user out of the user table.
The user id has two constraints and serves as a foreign key in
two other tables named 'messages' and 'comments' as an attribute with name "MadeBy" (both tables have the same naming for the foreign key).

Because I want to ensure integrity is still ok, I dont know which rows of which table to delete first or HOW to make a statement that deletes the rows out of the tables so i can finally delete the user
out of the user table.

Table 'messages' and 'comments' have the foreign key 'user.id'
i want to delete a user row, but i have to delete the rows out of the other tables first. How do i do that?

Thank you very much



Similar Threads
Thread Thread Starter Forum Replies Last Post
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 12:16 AM
Similar Delete Cascade prasanna.nadgir C# 6 August 28th, 2007 04:12 AM
Delete Data from a SQL Database using vb 2005 sahmed1983 VB Databases Basics 2 December 11th, 2006 03:16 PM
How apply cascade update/delete in sql server ? method SQL Server 2000 2 May 14th, 2005 12:02 PM
Urgent: Implement Cascade Delete through Code rcmetta BOOK: Professional Crystal Reports for VS.NET 0 June 7th, 2004 12:49 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.