Re: Easy question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Kenny (pearl_77_at_hotmail.com)
Date: 07/20/04


Date: Tue, 20 Jul 2004 18:08:24 -0400

well, we want to able to group by TestId later.
that's why DATETIME doesn't work. Anyway, I found an alternate solution:
always set testID to -1 in the beginning, once
data get inserted, then another update statement updates TestId from -1 to
max(testId)+1
=)

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message
news:KPqdnc68rfgJrGHd4p2dnA@giganews.com...
> If test is just supposed to show the *sequence* in which the rows were
> inserted why not use a DATETIME column with a DEFAULT CURRENT_TIMESTAMP to
> record that information. That way you can calculate the value of "TestID"
in
> a query based on the sequence of the DATETIMEs.
>
> --
> David Portas
> SQL Server MVP
> --
>
>