home *** CD-ROM | disk | FTP | other *** search
/ gimli.bioss.sari.ac.uk / gimli.bioss.sari.ac.uk.zip / gimli.bioss.sari.ac.uk / pub / misc / McAfee8.7.Zip / ePOPolicyMigration.exe / CABFILE / 1 / Timestamps_Update_Script.sql < prev    next >
Text File  |  2007-02-28  |  1KB  |  46 lines

  1. if exists (select * from tempdb..sysobjects where name like '#vsepolicytime%')
  2. drop table #vsepolicytime
  3. go
  4.  
  5.  
  6.  
  7. begin
  8. -- Update the timestamps so that the agents know there are new policies
  9. declare @Currenttime int
  10. select @Currenttime = @@dbts
  11.  
  12. update policy set TheTimestamp = @Currenttime
  13. where ProductCode = 'VIRUSCAN8600'
  14.  
  15. select parentid as autoid, parenttype, max(thetimestamp)as maxtime
  16. into #vsepolicytime
  17. from policy
  18. where ProductCode = 'VIRUSCAN8600'
  19. group by parentid, parenttype
  20.  
  21. update leafnode
  22. set policytimestamp = #vsepolicytime.maxtime + 1
  23. from #vsepolicytime
  24. where leafnode.autoid = #vsepolicytime.autoid
  25. and #vsepolicytime.parenttype = leafnode.type
  26.  
  27. update branchnode
  28. set policytimestamp = #vsepolicytime.maxtime + 1
  29. from #vsepolicytime
  30. where branchnode.autoid = #vsepolicytime.autoid
  31. and #vsepolicytime.parenttype = branchnode.type
  32.  
  33. update policysettings set TheTimestamp = @Currenttime
  34. from policy
  35. where policysettings.parentid = policy.autoid
  36. and policy.ProductCode = 'VIRUSCAN8600'
  37.  
  38. end
  39. go
  40.  
  41. if exists (select * from tempdb..sysobjects where name like '#vsepolicytime%')
  42. drop table #vsepolicytime
  43. go
  44.  
  45.  
  46.