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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Delete data from multiple tables

Author  Topic 

velliraj
Yak Posting Veteran

59 Posts

Posted - 2009-07-17 : 13:18:24
hi
is it possible to delete the data from multiple table by using the single delete statement.

please suggest.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-17 : 13:29:41
nope. its not possible. you need seperate delete statements for both.
Go to Top of Page

velliraj
Yak Posting Veteran

59 Posts

Posted - 2009-07-17 : 13:34:20
what is meant by cascade delete.whats is the use of this.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-17 : 13:38:29
cascade delete is a clause which when specified with foreign key definition would cause automatic deletion of referred records from child table when the record containing value they refer to has been deleted from the parent table
Go to Top of Page

velliraj
Yak Posting Veteran

59 Posts

Posted - 2009-07-17 : 13:45:22
syntax for cascade delete
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-17 : 13:53:49
ALTER TABLE table ADD CONSTRAINT FK_ConstName (Column) REFERENCES ParentTable (column) ON DELETE CASCADE
Go to Top of Page
   

- Advertisement -