Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Daily autoreset user-defined counter
Message
De
15/01/2001 08:32:22
 
 
À
14/01/2001 17:18:58
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00463494
Message ID:
00463724
Vues:
15
You can create the counter field with and column defined with the IDENTITY property. Then daily you can reset the identity value with the following command:

DBCC CHECKIDENT(tablename, reseed, 0)

Schedule this as a job using SQL Server Agent. The only issue might be one of timing. You may not be able to guarantee that the value is reset before a value is written to the table at 1200AM.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform