D
Darrel
I have a table that stores the content for a web site I'm making. Each one
has a unique ID so I can grab it via the querystring.
Since it's being done via a query string, I didn't want to use default
GUIDs, since they're just really verbose.
So, I'm just making my own. What's the best way to check for uniqueness on
insert? My thinking was that I'd query the ID field, set it to an array, and
then loop through all of the variables. ie:
----------------------------
count = 1
while any variable in array = count then
count = count+1
end while
new item's ID = count
-----------------------------
That would work, but could get extremely intensive if it were a large db.
So then I thought perhaps I'd just grab all IDs, and then sort the array,
grabbing the highest one and just add one to it. That would work too.
Are there other methods I should consider? Is there a way (via SQL?) to
automatically enter in a unique ID without needing the huge GUID?
-Darrel
has a unique ID so I can grab it via the querystring.
Since it's being done via a query string, I didn't want to use default
GUIDs, since they're just really verbose.
So, I'm just making my own. What's the best way to check for uniqueness on
insert? My thinking was that I'd query the ID field, set it to an array, and
then loop through all of the variables. ie:
----------------------------
count = 1
while any variable in array = count then
count = count+1
end while
new item's ID = count
-----------------------------
That would work, but could get extremely intensive if it were a large db.
So then I thought perhaps I'd just grab all IDs, and then sort the array,
grabbing the highest one and just add one to it. That would work too.
Are there other methods I should consider? Is there a way (via SQL?) to
automatically enter in a unique ID without needing the huge GUID?
-Darrel