Information générale
Forum:
Microsoft SQL Server
Versions des environnements
SQL Server:
SQL Server 2008
>Hi
>
>I'm dealing with a system that in one area uses keys generated keys using GETDATE().
>
>This is producing duplicates sometimes.
>
>If I select GETDATE() in a loop it returns the same datetime through a lot of iterations . How often is the date and time refreshed and what sort of delay would I need to introduce to ensure I got a new date and time on each key generation.
>
>
>Thanks
IIRC there is some "granularity" in the results returned on the system time. Back in the DOS days the granularity was around 55 milliseconds from the BIOS clock (one of the hardware timers was programmed to complete a cycle of 65536 ticks in one hour -- this results in ~18.2 ticks per second --> 55ms between ticks). IIRC the resolution might be higher nowadays (~1 millisecond), though I wouldn't count on it (just to be safe).
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement