I'm using Microsoft SQL Server 2008 R2 for a JEE Application (JSF, JPA, EclipseLink).
I restart my database weekly and doing that I need to update the sequence of all my tables like that:
UPDATE[dbo].[SEQUENCE]
SET [SEQ_COUNT] = (SELECT MAX(IDAGENCE)
FROM AGENCE)
WHERE SEQ_NAME = 'SEQ_AGENCE'
My question is: how do I trigger a script when I restart my database to update all my sequences?
Thanks you for your help