Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9118679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:12:44+00:00 2026-06-17T05:12:44+00:00

I do not wish to prevent table drops, but when certain tables are dropped

  • 0

I do not wish to prevent table drops, but when certain tables are dropped in a database I would like to back up either the entire table or query the rows and select specific rows into another table before the drop.

With a normal trigger on a table, if a row was deleted you could access the ‘Deleted’ table and access those deleted rows.

The DROP_TABLE trigger fires after the table is dropped.

Is there an equivalent to the Deleted table for a DROP_TABLE trigger?
Is there a different approach I could use?
Or am I going to have to re-code the business logic in the windows service which creates and drops these tables?

(I REALLY don’t want to write a trigger which rolls-back the drop, accesses and copies-out the data, then re-drops the table without firing the trigger recursively. I like inventiveness, but this is too mucky a solution for me)

I am running this on Microsoft SQL Server Enterprise Edition (64-bit)
and Microsoft SQL Server Developer Edition (64-bit)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:12:45+00:00Added an answer on June 17, 2026 at 5:12 am

    Thanks for the help guys, but to directly answer my own questions:

    1. For DDL triggers (which fire for DROP TABLE), there is no equivalent to the Deleted table within DELETE/UPDATE triggers

    2. There is no equivalent solution without rolling-back the drop, copying-out the data and re-issuing the drop

    3. The only appropriate and correct approach is to re-code the business logic in the windows service which creates and drops these tables – to permit a soft-delete/move/rename when required

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a list that I wish not to return but to yield
I would like to define a template function but disallow instantiation with a particular
I wish to create a trigger that would PREVENT any deletion on a given
I am not familiar with android programming, I wish to know if there is
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
Fist time using fancybox and it's not going so well.. starting to wish I
I have numerous Corba servers and some other java apps (not web). I wish
Not ever sure if it can be done, but is it possible to use
We wish to make a desktop application that searches a locally packaged text database
I would use the hosting for live testing, but I want to protect access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.