Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to drop the second table automaticlly
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

19 Posts

Posted - 09/28/2006 :  19:05:50  Show Profile  Reply with Quote
Hi All,
I have two table like TABLEA and TABLEB and whenever the user drops the TABLEA I would
like the TABLEB is automaticlly drop as well. Do I need to use the triggers and what
should I use to add the logic in for whenever the user issues the command to drop the
TABLEA the TABLEB will be dropped too.

Flowing Fount of Yak Knowledge

1837 Posts

Posted - 09/28/2006 :  19:47:25  Show Profile  Reply with Quote
On SQL Server 2000 you cannot create triggers for DDL statements like dropping a table (you can do that on SQL Server 2005).

Users really shouldn't be dropping tables, but without knowing more about your specific case I'll assume you have good reason for doing it.

Is this just for random tables or for specific situations - you should be able to create a stored procedure that drops both tables so that the user application just calls the stored procedure.
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 09/28/2006 :  21:14:47  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Duplicate of


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000