Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. update coreweb.AutomatlarmsInfo set AutomatlarmSkaDebiteras=1 where InsatsrapportId in (
  2. select r.InsatsRapportId from coreweb.Insatsrapporter r
  3. join coreweb.Handelser h on r.InsatsrapportId=h.InsatsrapportId
  4. join coreweb.AutomatlarmsInfo a on r.InsatsrapportId=a.InsatsrapportId
  5. where Tillstand in (2,3) and
  6. h.UtlosandeHandelse=171 and
  7. r.SkaDebiteras=1 and
  8. a.AutomatlarmSkaDebiteras is null
  9. )
  10. update coreweb.AutomatlarmsInfo set AutomatlarmSkaDebiteras=0 where InsatsrapportId in (
  11. select r.InsatsRapportId from coreweb.Insatsrapporter r
  12. join coreweb.Handelser h on r.InsatsrapportId=h.InsatsrapportId
  13. join coreweb.AutomatlarmsInfo a on r.InsatsrapportId=a.InsatsrapportId
  14. where Tillstand in (2,3) and
  15. h.UtlosandeHandelse=171 and
  16. r.SkaDebiteras=0 and
  17. a.AutomatlarmSkaDebiteras is null
  18. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement