R
Ronald S. Cook
I have tables in my database-based Web app like Player, Club, and
Tournament.
In each, I have an identity primary key column "ID" (1, 2, 3, 4.). I also
have a column "Number" which is a char(6) to contain the player, club, or
tournament 6-digit number (e.g. 493192). This value will be visible in the
site and used by the user (i.e. not a hidden key behind the scenes).
The only thing I'm not crazy about is that the ID value (while
behind-the-scenes), does appear in the URL at times (e.g.
mysite.com/player.aspx?ID=17). While I could use the Number value instead,
I don't believe this is the most proper way to do it (i.e. using keys is
more appropriate).
I know it's not a big deal for users to see ID keys passed around, but I'd
prefer they didn't.
I've heard the suggestion to do away with the Number column and seed the ID
column to begin at 100001, but I think this is bad design. If, for example,
a user had "666" in there ID and demanded it be changed, then propagating
the value becomes an issue. I know cascading updates aren't a big deal, I
just think its bad design. The PK is supposed to be an arbitrary unique
identifier to be used behind the scenes.
Any opinions on this?
Thanks,
Ron
Tournament.
In each, I have an identity primary key column "ID" (1, 2, 3, 4.). I also
have a column "Number" which is a char(6) to contain the player, club, or
tournament 6-digit number (e.g. 493192). This value will be visible in the
site and used by the user (i.e. not a hidden key behind the scenes).
The only thing I'm not crazy about is that the ID value (while
behind-the-scenes), does appear in the URL at times (e.g.
mysite.com/player.aspx?ID=17). While I could use the Number value instead,
I don't believe this is the most proper way to do it (i.e. using keys is
more appropriate).
I know it's not a big deal for users to see ID keys passed around, but I'd
prefer they didn't.
I've heard the suggestion to do away with the Number column and seed the ID
column to begin at 100001, but I think this is bad design. If, for example,
a user had "666" in there ID and demanded it be changed, then propagating
the value becomes an issue. I know cascading updates aren't a big deal, I
just think its bad design. The PK is supposed to be an arbitrary unique
identifier to be used behind the scenes.
Any opinions on this?
Thanks,
Ron