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 8117817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:17:57+00:00 2026-06-06T04:17:57+00:00

I have a delete issue at the moment. We do not have permission to

  • 0

I have a delete issue at the moment. We do not have permission to enable Cascade delete on the record. I have User table where userId is references in about 20 different table. I want to be able to write a dynamic query which would go and recursively find all tables that reference userId and delete those (for each table it will have to find its own foreign key and delete them as well), so basically a recursive function/procedure which would take table name as a parameter and primary key id and will perform cascade delete. Any script that can do that? I can run a query on information_schema to retrieve one level of dependencies for User table, but I need to somehow recursively find all dependencies of the linked tables as well to be able to wipe the record.

  • 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-06T04:17:58+00:00Added an answer on June 6, 2026 at 4:17 am

    As suggested by “Nathan Skerl” I used this link http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=97454 and it did the job. The only thing is that I modified fnCascadingDelete function to include RecordID parameter so you can pass id of the record you want to delete then I searched for %1 and replaced it with @RecordID. It works perfectly, a bit slow for very deep nesting but I guess it is expected.

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

Sidebar

Related Questions

I have been having an issue with the $this->delete() method that deletes a record
I want to have a delete user link in a normal Activerecord table, but
I have a delete form wherein the user will enter the pnum to be
I have an issue at the moment where multiple (same schema) access 2003 databases
I have the following Delete confirmation code using jquery. The issue is that it
Again I have a question about an ssh issue: On a embedded system (no
I have a strange issue with delete rules in coredata. My data model is
suppose i have one instead of trigger for a table before delete. so i
I have a delete trigger on table A that deletes from table B. I
I have an issue here, I'm not sure if it's possible but I would

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.