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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:30:13+00:00 2026-05-21T07:30:13+00:00

I have a table in which in one of the column I would be

  • 0

I have a table in which in one of the column I would be specifying the type of entity.The entity could only be of three types – caption , image or comment , hence I want to ensure that the table column should only accept one of these three strings . Is there a way to put this constraint in ms sql server 2008 ?

Edit :- Have added the db diagram to get tips on improving the design.

Design :-
1)A story board has a number of slides, each slide can have one or more captions or images.

2)Each storyboard can have one or more author , and zero or more reviewers.

3) Each of the objects image,slide and caption(probably more objects will come later like audio etc) can have comments on them . These comments can be given by authors or reviewers.
For storing comments I have created a comment table.

4)It is necessary to remember the order of slides and order of images in a slide , for which I am using slide and image number fields.

5)Since comment can be given on any object , I needed to have a Global ID for each of the object,since they their reference will be stored in a comment table.For maintaing a global id all the fields ending with name GID are uniqueidentifiers generated using Default: NEWID().

Please suggest improvements for this db design.

Database Diagram

  • 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-21T07:30:14+00:00Added an answer on May 21, 2026 at 7:30 am

    Aha, the nature of the problem is different in that case! Hence my 2nd answer here.

    I’ll admit I’m not 100% sure what the ‘best’ solution is. I think how you plan to query this data will dictate the way you store it, to a certain extent.

    From the extra info that you’ve posted, I’d suggest stripping back the Comment table so that it only stores information about comments. Lose the ObjID, ObjType fields and possibly usertype too – shouldn’t that be in the User table?

    Then, I’d suggest ading three new tables to your schema: SlideComment, CaptionComment and ImageComment, each with just two fields:
    One to store the CommentId (which will have a FK to the Comment table) and another to store the Slide-, Caption- or Image- GID as appropriate.

    So, these new tables are used solely to join the Comment to whichever entity they were made on. That should enable you to query the data in the way you want without having to worry which ‘entity’ it refers to.

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

Sidebar

Related Questions

I have a table in which one column (type ntext) has data that includes
I have a logging table which has three columns. One column is a unique
i have a large mysql database table in which one column contains values ranging
I have a database table named 'student' in which there is one column named
I have a table in Oracle where one of the column contains UserIds which
I have a table which needs to link one of three seperate tables, but
I have one table which display data as from Dynamic Content in 1 column.
I have a fusion table that contains kml data in one column which shows
I have a table which would contain information about a certain month, and one
I have 2 tables in which one column in one table will reference one

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.