General information
Category:
Coding, syntax & commands
>Can someone give me advice on the best way to assign primary key field values to individual records in a table. I have tables where the only unique value field is a description field. I don't want to use a 50 character description field as the primary key. I have routines to generate a key based on a counter. Is this the best way to assign values?
IMHO yes
what i do is as follows :
i have a table which holds the keys, thier type and the current value
and i have a routine in the stored procedure that takes as a parameter
the name of the key - serached the table increase the value by one
and return the new value
i call this funtion from the key field "default value"
HTH
Arnon Gal-Oz
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only