Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Daily autoreset user-defined counter
Message
De
17/01/2001 00:35:48
 
 
À
15/01/2001 08:32:22
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00463494
Message ID:
00464545
Vues:
13
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





Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform