Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Daily autoreset user-defined counter
Message
From
17/01/2001 00:35:48
 
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00463494
Message ID:
00464545
Views:
14
Thanks Michael and Bob for reply!

I came up with another solution very similar as your. I create a Sql statement in the insert trigger to know the last print I made, then I compare this date with the cuurent date, if both are the same then I just insert a row else I reset the counter and insert the row.

Select Top 1 max(PrintDate) as OldDate from myTable order by PrintDate Desc

if DateDiff(dd, GetDate(), OldDate) = 0
Exec spInsertSerialNumber
else
DBCC CheckIdent(MyTable, ReSeed, 0)
Exec spInsertSerialNumber

Thanks so much!

Martin Alcaraz
malcaraz@rtn.uson.mx





Previous
Reply
Map
View

Click here to load this message in the networking platform