Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2009, 10:11 AM
Authorized User
 
Join Date: Feb 2007
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table Design Limiting allowed values in a field

Hello,

I am busy designing a number of tables and for some fields I want to limit the allowed values. For example

field: currencies: allowed values: GP, EUR, RUP, USD
gender: allowed values: M, F

In doing so entering FL or DEM in the field currency will not be accepted
C in the field gender will not be accepted

What to do.

Many thanks in advance

John
 
Old January 29th, 2009, 12:22 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

You could put these values into drop-downs or radio buttons is one way to handle this but I think the best way is to create a Currencies table with an identity column, put the values into a drop-down and save the identity value in the parent table.

For male and female you could use a bit column.
 
Old January 30th, 2009, 12:28 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Lookup "constraints, CHECK" in Books Online.
__________________
--Jeff Moden
 
Old February 2nd, 2009, 04:33 AM
Authorized User
 
Join Date: Feb 2007
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks!

Thanks for your help!

Kind regards,

John





Similar Threads
Thread Thread Starter Forum Replies Last Post
find multiple values from a table field raaj Beginning PHP 0 September 17th, 2007 03:51 AM
limiting/hiding records w/null values louisvillelivin Crystal Reports 0 February 5th, 2007 10:43 AM
Multi-field entry design and reporting Nanette Access 2 October 26th, 2006 11:02 AM
Best way to initialize values for design mode? WebDunce VB Components 1 March 31st, 2006 09:55 AM
Limiting of Calc. Field Output to 2 decimals Vince_Kingston SQL Language 1 June 9th, 2003 01:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.