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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:38:17+00:00 2026-06-08T07:38:17+00:00

The NAME field of a sql table is a composition of other fields: 1_2_UserId_CreationDatetime

  • 0

The NAME field of a sql table is a composition of other fields:

1_2_UserId_CreationDatetime e.g. 1_2_domain\Elisa_15-07-2012 08:30:57

My NAME field has a Unique Constraint to express that equal names are not allowed. The primary key is an auto inc id.

Does it make now sense to catch an UniqueConstraintException when a new datarow is inserted but actually its not possible to have the same name twice because then a user must be logged into the web application 2 times and press the button in the same second etc…

Should I really test such a scenario ?

Update

Thats the workflow:

A user creates a new testplan by choosing from a list of templates And release.

Then the testplan is saved with the releaseName_templateName_UserId_CreationDate

But in the 4 fields the releaseId, templateId, UserId and CreatedDate is saved.

To show the user as a NAME the releaseId and templateId (both are int`s) does not make sense.

Therefore I save the NAME with all 4 part_names.

enter image description here

Another design alternative to this composite NAME field could be to remove the NAME field from the Testplan table and when I load all testplans I try to get the releaseName and templateName for every releaseId and templateId.

What do you think? Well please also remember my origion question about the edge case…

  • 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-08T07:38:18+00:00Added an answer on June 8, 2026 at 7:38 am

    The way you’ve described the test it sounds like the test would simply test that the RDBMS is functioning properly–not something you really should be concerned with (if the RDBMS doesn’t work, you user another). Either that, or you’re testing your schema. I’m not really sure there’s much value to this. If the unit test fails, what do you expect to do? Will you verify the schema is correct and if it is, then what? If you’re performing many other tests to validate the schema hasn’t been changed to expected values then a test like this might make sense. If not, it doesn’t make much sense to me.

    Now, if your application handled this UniqueContraintException and did something specific, a test to verify the application performs expectedly makes sense.

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

Sidebar

Related Questions

in an sql table there's an id, first name and last name field. i'd
SQL Server: Table Name : Dad Fields: Id Table Name : Mom Fields: Id
Is table name prefix for fields to be update not allowed in SQL ?
I have an XML field in SQL table like this <Root> <Name>Apollo</Name> <Code>1000</Code> <Code>2000</Code>
The SQL Server (2000/2005) function gets the table name and the field name as
I have a simple database table (SQL Server 2008 R2 Express), which has a
I have the following MS-Access SQL Table:- NAME, SUBJECT, SCORE ..and I need to
I have a table Student with 2 fields: Name: nvarchar(256) Age: int User will
for example: the table named products there is a product name field in the
I have the following SQL table: ObjectTable -------------------------------------------------- | ID | Name | Order

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.