Wrox Programmer Forums
|
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 February 24th, 2004, 05:26 PM
syu syu is offline
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data Type for table ID

Hi everyone,

I was wondering how to determine the datatype of my table. For example, I have a Operator table, which datatype should I use for OperatorID?

Thank you in advance.
Sherry

 
Old February 25th, 2004, 01:00 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

How would you like to identify your Operators? Should the OperatorID be a string value like a user name? Or is this field something that should be generated by the database?
 
Old February 26th, 2004, 06:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

if u ask me I'd rather to use SMALLINT but if u think ur range need more use INT or even BIGINT.
HTH.

Always:),
Hovik Melkomian.
 
Old February 26th, 2004, 11:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by syu
 Hi everyone,

I was wondering how to determine the datatype of my table. For example, I have a Operator table, which datatype should I use for OperatorID?
What's an 'OperatorID'? What does it describe? The datatype for any attribute should be that type which is necessary and sufficient to completely represent that which the attribute describes.

Your question is like asking me what color paint you should buy. I can't possibly answer that question without knowing what you intend to do with it.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to parse xml with an attributes of type ID kirkpng XSLT 1 January 25th, 2005 04:44 PM
update table with an ID Num from different table scoobie PHP How-To 12 January 25th, 2005 12:28 PM
Data Type error but it is the correct type Mitch SQL Server 2000 2 March 19th, 2004 11:31 AM
size of table (type table is table of number) MikoMax Oracle 1 November 19th, 2003 03:11 AM





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