Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 11th, 2008, 08:24 AM
Authorized User
 
Join Date: May 2007
Location: Frankfurt, Germany, Germany.
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.

summary:
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

DarkForce

Ivan
__________________
Ivan
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:07 AM.


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