|
Posted by David Portas on 03/13/06 09:48
(comments inline)
Doug wrote:
> Let me try two examples.
>
> Lets say I give you one dollar bill. Now I give you another dollar
> bill. Do you immediately throw away one of them as being redundent?
I don't see what relevance that has to databases.
> Another example. "Existence" is valid data, and valid information.
Agreed.
> The
> simple fact that I got a website hit is important. If I get two website
> hits at the exact same time, I may still need to track that website
> hit, especially if I get paid by the website hit. There may be no
> unique natural key, but it is still awfully nice to have a way to
> manipulate them individually if need be, and have "record" they came
> in.
So couldn't the (simplified) table look like this:
CREATE TABLE hits (hit_datetime DATETIME ip_address VARCHAR(15),
num_of_hits INTEGER NOT NULL, PRIMARY KEY (hit_datetime, ip_address));
It isn't obvious what you mean by "manipulate them individually if need
be". You are saying you want to see a row per hit? Why?
> Sequential is inconsequential. Even bad code shouldn't count on
> sequential identities.
I agree.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
[Back to original message]
|