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

  • Home
  • SEARCH
  • 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 465181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:21:01+00:00 2026-05-12T23:21:01+00:00

i have an Applications table and a Resources tables. Since many resources can work

  • 0

i have an Applications table and a Resources tables. Since many resources can work on a single application and many applications can be worked on by a single resource, i created a 3rd table:

ApplicationResources:
– ID (int)
– ApplicationID (int)
– ResourceID (int)
– PctOfTime (float)

is there anyway in the database itself that i can ensure that the total of all resources’s PctOfTime added up to 100%?

  • 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-12T23:21:02+00:00Added an answer on May 12, 2026 at 11:21 pm

    There’s no declarative way to do that in SQL.

    You can accomplish this using a trigger (a stored procedure that is run whenever a row in the ApplicationResources table is INSERTed, UPDATEd or DELETEd. The trigger can test the condition and reject the change if it would cause the condition to be false.

    The problem is that you might need to allow the table to be briefly invalid. For instance, if you DELETE a record for a resource, the condition will not be true until you add or update one or more records to get back to 100%. In order to get that to work, you’d need to defer your trigger until the end of a transaction and the ability to do that varies among databases.

    Your problem is easier to deal with if you want the condition to be that no resource can ever be more than 100% allocated (and that allows for resources that are not fully utilized as well).

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

Sidebar

Related Questions

Many applications have grids that display data from a database table one page at
I have 3 tables called: Applications (id, name) Resources (id, name) ApplicationsResources (id, app_id,
In one of my applications I have a 1gb database table that is used
I have an application that reads a table from a database. I issue an
In my iPhone application I have a table view. When user taps any row,
I have table rows of data in html being filled from a CGI application.
I have a pretty standard table set-up in a current application using the .NET
I have an Oracle table which contains event log messages for an application. We
I have an Access 2002 application which links an Oracle table via ODBC with
In an embedded application, we have a table describing the various address ranges that

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.