[AccessD] Access and SQL Server

Jim Dettman jimdettman at verizon.net
Mon Feb 28 16:36:49 CST 2011


Stuart,

<<Do you ever use anything other than longs for PK?   If so, why?>>

  Occasionally on a lookup table if a client insists on having a short code
along with a description.  Then I do this:

LookupCode - Text - PK
Description - Text

  as I don't see any sense in doing this:

LookupID - Autonumber - PK
Code - Text - CK
Description - Text

  However I do my best to steer them to:

LookupID - Autonumber - PK
Description - Text - CK

  And usually on straight lookup tables, I cheat a bit and do this:

tblLookupTypes
LookupTypeID - Autonumber - PK
Description - Text 
UserModify - Yes/No

tblLookupValues
LookupID - Autonumber - PK
LookupTypeID - Long - FK to tblLookupTypes
Description - Text

 and then use views to represent the different types rather then going
against multiple tables.  But if I need any attributes outside of a code or
description, then I break things into separate tables.

 This means one maintenance form for all the lookups.  Not great
relationally, but it works fine and saves a ton of work when a lot of
lookups exist in an app.

Jim.
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Monday, February 28, 2011 04:23 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access and SQL Server

Do you ever use anything other than longs for PK?   If so, why?

(Apart from GUIDs in rare circumstances)

-- 
Stuart

On 28 Feb 2011 at 14:27, Jim Dettman wrote:

>   There are restrictions on the data types, control events, primary
>   keys
> (all must be longs).
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list