In article <1ikt6eINNh61@meaddata.meaddata.com>, jimj@meaddata.com (Jim Johnstone) writes:
|> We have a need to query out all rows entered by a given user since a specified
|> time. My first thought was to use timestamp columns in all tables. So (I am
|> very new to Sybase, so please be nice) my questions are:
I have a great "horror story" for you! :^( - I once had an an application that used a timestamp column for this purpose, until one day THE TIMESTAMPS ROLLED OVER (reset back to a lower value) and EVERYTHING IN THE DATABASE GOT SELECTED!
You can't count on the sybase timestamp value as an always increasing number!
(our experience was under SQL Server 4.0.1; your mileage may vary.)
|> 1. Are timestamps the best way to go?
|> (nice because they are automatic, bad because they can't be CONVERTed)
|>
|> 2. Should I just use datetime in each table?
|> ... insert TABLE values(..., getdate(), ...)
|> then
|> ... select * from TABLE where date > @threshold and user = @user>
|> 3. Is there some Sybase table/feature that will allow me to meet the
|> requirement directly?
|>
|> 4. How would you handle this requirement?
Use a datetime column and a trigger to keep it updated.