Re: Easy question
From: Kenny (pearl_77_at_hotmail.com)
Date: 07/20/04
- Next message: Zach Wells: "Re: Determining if a bit is set"
- Previous message: Joe Celko: "Re: Determining if a bit is set"
- In reply to: David Portas: "Re: Easy question"
- Next in thread: David Portas: "Re: Easy question"
- Reply: David Portas: "Re: Easy question"
- Messages sorted by: [ date ] [ thread ]
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
> --
>
>
- Next message: Zach Wells: "Re: Determining if a bit is set"
- Previous message: Joe Celko: "Re: Determining if a bit is set"
- In reply to: David Portas: "Re: Easy question"
- Next in thread: David Portas: "Re: Easy question"
- Reply: David Portas: "Re: Easy question"
- Messages sorted by: [ date ] [ thread ]