Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Daily autoreset user-defined counter
Message
From
15/01/2001 08:32:22
 
 
To
14/01/2001 17:18:58
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00463494
Message ID:
00463724
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform