Do you truely have enough control over the document numbers such that
an identity field can be used as the doc ID?
This means:
you cannot control the number that is assigned
you may have missing numbers
you cannot easily reserve/preassign blocks of numbers
If so, you can do the following:
CREATE TABLE Documents
(
DocID Integer Identity,
StateID Integer,
.
.
.
PRIMARY KEY (DocID, StateID)
)
HTH
Dick
At 7:12 AM -0400 6/6/2000, Smith, Melanie wrote:
>HELP! I've posted this twice. Does anyone know how to do this?
>
>----------------------------------------------------------------------------
>-------------------------------------
>> Does anyone know the best way to create autonumbers using SQL 7.0 similar
>> to the following:
>>
>> First Document ever created in NY where NY = code "01", DocID = 9000001-01
>> 2nd Document ever created in NY = DocID = 9000002-01
>>
>> First Document created in MD (Code = "02"), DocID = 9000001-02
>> 2nd Document created in MD = 9000002-02
>>
>> First Drawing created in NY site = DocID = 8000001-01
>> 2nd Drawing in NY = 8000002-01
>>
>> So grab the doctype (drawing or doc) AND the site off the form, query
>> against some tables and determine next number, then assign it with the
>> trailing suffix. Can I use "01" or "02" as some sort of trailer and still
>> use an identity type field or do I have to define it as integer or alpha
>> type? I could also use ".02" and ".01" if that would make it easier
>> (i.e., I could use a number type versus alpha). Much thanks to any
>> insight anyone has to offer!
>------------------------------------------------------------------------------
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.