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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:57:31+00:00 2026-05-15T19:57:31+00:00

I am trying to create a Task schema in my database. One field is

  • 0

I am trying to create a “Task” schema in my database. One field is “blockedBy” which represents another Task that is blocking this current task.

I am new to SQL Server and databases in general. How can I create the table properly? It seems like the only valid options are numbers or text.

Should I just store the ID number of the other “Task” in the “blockedBy” field or is there a better way?

  • 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-15T19:57:31+00:00Added an answer on May 15, 2026 at 7:57 pm

    I assume:

    • you have a schema called “Tasks” in a database in SQL Server
    • you then have a table (say, AllTasks) that stores task information
    • you would like to have a field called blockedby that indicates which existing task is blocking the current task

    Here’s my proposal of columns, and an example of how the data would look like:

    TaskID   TaskName    TaskDescription .....   TaskBlockedBy
    ------   --------    ---------------         -------------
    1        Eat         Eat food                <NULL>
    2        Drink       Drink, um, water        <NULL>
    3        Sleep       Ah, peace!              <NULL>
    4        Wake Up     Crap                    3
    

    Wake up task in row 4 is blocked by Sleep task in Row 3.

    Table fields will have datatype:

    TaskID int (identity/autonumber)
    TaskName nvarchar(50) not null
    TaskDescription nvarchar(200) not null
    TaskBlockedBy int
    

    If you anticipate multiple existing tasks blocking a task, break up the table into 2 tables: AllTasks and BlockedTasks. AllTasks table will not have TaskBlockedBy field anymore and BlockedTasks and its data will look like this:

    BlockID  TaskID  BlockedBy
    -------  ------- ----------
    1        4       3
    2        4       2
    

    This indicates that task of Wake Up was blocked by Sleep and what the user drank before sleeping.

    HTH

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

Sidebar

Related Questions

I'm trying to create a Rake task that invokes two other rake tasks. I've
I'm trying to create a scheduled task (in WinXP) which runs every 10 minutes,
I am trying to create a rpm package using ant task for that I
I'm trying to create a scheduled task that updates less than 5% of the
I'm new to SSIS and trying to create a dataflow task that will accomplish
I'm trying to create a build script for my current project, which includes an
I have the following task: Create one website which is accessible with 20 different
I'm trying to create a plugin which creates a task in response to the
I am trying to create a Zip task that would create a distribution package
I'm trying to create a packaged task with a functor like this: Worker w(someString,

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.