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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:16:45+00:00 2026-05-15T00:16:45+00:00

I am putting together a table that will be used to send follow up

  • 0

I am putting together a table that will be used to send follow up messages to certain requests for information. A request is sent to a group of people and responses are tracked. If a person fails to respond, zero or more follow ups might be sent. I created a table:

FollowupId int primary key, 
RequestId int foreign key (outside this example), 
Follows int foreign key (FollowupId), 
Message varchar

If a message is to be the first follow up message, Follows will be null. Otherwise, it is the id of some other Followup. I also added a unique constraint on Follows. That is, no more than one message can follow any given message.

EDIT: I should also highlight the foreign key on Follows. It references FollowupId in this table. So if A->B->C, just deleting B makes the foreign key in C invalid. Similarly, it’s not possible to just update C to follow A because B is already following A and the unique constraint forbids the duplication.

The problem is, of course, that deleting follow up entries is now difficult if that message is followed by another. It seems to me that it should be possible to disable the constraint checking to make it possible to delete a middle followup, “move up” subsequent followups, and then reenable the checking. Is there some way to disable the constraint only for the duration of a transaction?

(Also, I am aware of the possible data inconsistency that arises by having RequestId in this table. It might be better to have Followups [FollowupId, Message], InitialFollowups [FollowupId, RequestId], and FollowingFollowups [FollowupId, Follows] tables. I think it unnecessarily complicates this example though.)

  • 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-05-15T00:16:46+00:00Added an answer on May 15, 2026 at 12:16 am

    Disabling/enabling constraints for some modification is usually a bad idea, and performance might suck. Whenever you are doing it, make sure that your constraint is not only enabled but trusted after you are done.

    In your case, you need to delete one row and modify another one. You should use MERGE if you already are on SQL 2008, that allows you to both delete and update in one command.

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

Sidebar

Related Questions

I've just started a new software consultancy business and I'm currently putting together designs
I'm putting together my own database and from examples I've seen, Foriegn Key can
Need some help with putting this query together. I'm using Mysql I have two
I'm putting together a sprite and have two questions. Something I've always wondered whether
I am putting together a Forum Stats website and I need to find the
I'm putting together user pages based on the username in the URL. for example
I am putting together an explanation and code example of this design pattern, attempting
I've decided that I'm not fond of the automatic filing and renaming provided by
I am in the process of puting together a custom workflow activity to be
Wonder if anyone has any thoughts on this, I'm putting a Wordpress theme toegther

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.