Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    14

    Unanswered: Making Unique ID's Unique

    I have a database that is comprise of over a hundred entries. The unique ID number is the only way we can pull up a specific record. Because the unique ID starts with number one and the fact is the number one is used fairly often in the entry fields, pulling up and searching for "1" is hard due to the entries being in the search results as well. Is there any way we can change the unique ID number? Maybe to start with R001 and runs on to be R002, R003, etc.? Thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by HandsOn View Post
    ... pulling up and searching for "1" is hard due to the entries being in the search results as well.
    wha???

    Quote Originally Posted by HandsOn View Post
    Is there any way we can change the unique ID number?
    depends on the dataype

    can we see your table layout?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jul 2010
    Posts
    3

    Making Unique ID's Unique

    Quote Originally Posted by HandsOn View Post
    I have a database that is comprise of over a hundred entries. The unique ID number is the only way we can pull up a specific record. Because the unique ID starts with number one and the fact is the number one is used fairly often in the entry fields, pulling up and searching for "1" is hard due to the entries being in the search results as well. Is there any way we can change the unique ID number? Maybe to start with R001 and runs on to be R002, R003, etc.? Thanks!
    It isn't necessary to search the "unique ID number" You can search any field in your table. Such as dates or names....Is the unique ID number some thing you created? Or is it a auto number you assigned to your table? Either way I would ignor it and search a more meaningful field.

  4. #4
    Join Date
    Aug 2010
    Posts
    1
    If you have set the field to be an auto increment long integer (or auto number depending on the version you have) then it will always be unique. As others have said it is not necessary (or wise) to search on unique numbers. If your database really grows how will you remember all the unique id's?

    Crys

  5. #5
    Join Date
    Jun 2010
    Posts
    3
    Quote Originally Posted by HandsOn View Post
    pulling up and searching for "1" is hard due to the entries being in the search results as well.
    Like others said, search for other fields instead.

    Even if you did have to search for your unique ID, you will specify both the exact table/query and field that it comes from, so it is still unique, as the name suggests.

  6. #6
    Join Date
    Aug 2010
    Posts
    1
    it's tough to say without knowing more about your app, searching for a '1' or an R1xxxx will have no difference in terms of ease of use, unless user is looking for say an invoice number and has the invoice with him, then maybe design it so that a partial search is supported by just entering parts of the actual number ...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •