April 25, 2008 at 1:41 am
Hi,
we have an application who can't read the information in a column call timestamp in a table of our database.
This timestamp is giving by SQL server for the active database (or someting like that)
We need to reset this timestamp (or to find a solution)
First solution but it's a lot of work to do is: to rewrite the application for it can read a very very long number giving by the timestamp
Second solution: export data, delete the original db, create the db (the timestamp reset by it self?) and import the data. But I will lost my user and have some probl with the pk et fk (I think)
Someone have any idea to reset the timestamp easely?
(sorry for my english, I'm french)
Thanks
J-F Lefebvre
April 25, 2008 at 3:06 am
Timestamp
Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type.
- From BOL
Knowing this, what would you want to read from timestamp column. I believe if you are trying to have some functionality linked up with this column, you would want to revisit your requirements and design.
Could you also please let us know your requirements on why you want to read this column? Maybe one of us could help in pointing an alternate solution.
Viking
April 25, 2008 at 3:19 am
as Viking already stated, a column of datatype timestamp is of very little use outside of the sql db.
Even trying to represent it is useless.
btw a timestamp column is automaticaly updated by sqlserver if an insert/update action has been performed.
So why would you use it.... to be sure your data hasn't changed since you've read it and some time later you want to update it and you don't want to have continuous open connections and locks.
update yourtable
set col1='newvalue'
where pk = pkvar
and tscol = mytsvar;
This will update 0 rows if that data has already been modified since the time you've read it.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply