Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server timestamp
Message
De
18/08/1998 11:05:14
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
À
18/08/1998 10:46:16
Chris Rahmes
Riverbend Nursery, Inc
Riner, Virginie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00127743
Message ID:
00127751
Vues:
25
>How can I read a SQL Server timestamp field in VFP?

The timestamp data type in SQL Server is not a date time field. It is a unique binary number that while it uses the current date and time when created it does not actually contain the date and time. If I remember correctly, it is a 16 byte unique key that is updated every time a record is modified. I also believe that SQL Server guarantees it to be unique for all rows in all tables within a database. If you want a date time field use the datetime or small datetime data types.

Timestamps are useful in determining if a record has been edited. In order to determine if a record has been modified since you last read it (because there is no useful record locking strategy in SQL Server) Your WHERE Clause can include the timestamp field, ie:
Update ...fields WHERE primarykey = ... AND timestamp = ...previous timestamp. If the record has changed since you first read the timestamp, the update will fail. Otherwise, you would have to check each field in the where clause.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform