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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:14:41+00:00 2026-06-16T19:14:41+00:00

I have a SQL Server database that holds a table where a varchar column

  • 0

I have a SQL Server database that holds a table where a varchar column has a check constraints on it to make sure only a few different words can be entered as a value (names).

Like this

CONSTRAINT chk_Names CHECK (name IN ('John', 'Eva', 'Carl', 'Fred'))

What I want do do is to populate a combobox in java with these names, and I don’t want to manually enter them since they might change in the database. I want to populate it from metadata.

But I haven’t been able to find a way to get the information from the database either with the INFORMATION_SCHEMA or sys.objects (or from DatabaseMetaData in java for that matter)

I’m quite new to SQL Server but is it possible to get that information somehow?

Regards
/Fred

  • 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-16T19:14:43+00:00Added an answer on June 16, 2026 at 7:14 pm

    It sounds like you should move the list of names to a table. You’re Java form could select the data from the table.

    And, because the data can change, it will be better to update the table than to change the check constraint. You can change the check constraint to a foreign key constraint too.

    You can also find the check-constraint definitions in INFORMATION_SCHEMA.CHECK_CONSTRAINTS. The expression is in the CHECK_CLAUSE column; and, you’ll have to extract the values from the expression.

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

Sidebar

Related Questions

I have an SQL Server 2008 database with a table that has a column
I have a SQL Server 2000 database that will not display the column list
I have a SQL Server 2005 database that has been deleted, and I need
We have a SQL Server 2008 database that has stored procedures to handle reads/writes/etc.
Ok I have a table in my SQL Server database that stores comments. My
I have a junction table in my SQL Server 2005 database that consist of
I have SQL Server 2008 database with 2 tables: Table A has columns ID
I have a varchar field in a SQL Server database that stores phone numbers
I have a local sqlite server. The SQL database only contains a table called
I have an old SQL Server 2000 database that I want to get into

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.