maxamill221

sql

Jan 4th, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. USE Rightfax
  2. GO
  3.  
  4. select
  5. FUSR.UserID, FUSR.UserName, FUSR.SID,
  6. FGRP.GroupID,
  7. STDIDNum, STGenFaxNum, STCallback, STOperNum, STFromName, STFromPhone, STToFaxNum, STToContactNum, STToName, STToCompany, STToCityState,
  8. FUSR.FCSModelName,
  9. CASE
  10. When FUSR.RouteType is NULL or FUSR.RouteType = 0 Then 'None'
  11. When FUSR.RouteType = 4 Then 'Folder'
  12. When FUSR.RouteType = 11 Then 'Exchange Mail'
  13. When FUSR.RouteType = 12 Then 'SMTP Mail'
  14. ELSE 'Unknown'
  15. END as [Route Type],
  16. FUSR.RouteInfo,
  17. CASE
  18. When FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'None'
  19. When FUSR.NotifyType = 0 Then 'Group Default'
  20. When FUSR.NotifyType = 18 Then 'SMTP Mail'
  21. When FUSR.NotifyType = 17 Then 'Exchange Mail'
  22. When FUSR.NotifyType = 16 Then 'Lotus Mail'
  23. ELSE 'Unknown'
  24. END as [Notify Type],
  25. FUSR.NotifyInfo,
  26. CASE
  27. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'None'
  28. ELSE CASE
  29. WHEN FUSR.ReceiveNotify is NULL OR FUSR.ReceiveNotify = 0 Then 'None'
  30. WHEN FUSR.ReceiveNotify = 1 Then 'Once when received'
  31. WHEN FUSR.ReceiveNotify = 2 Then 'Periodically until viewed'
  32. ELSE 'Unknown'
  33. END
  34. END as [Receive Notify],
  35. CASE
  36. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  37. ELSE CASE
  38. WHEN FUSR.SendNotify is NULL Then 'No'
  39. WHEN FUSR.SendNotify & 0x1 = 0x1 Then 'Yes'
  40. ELSE 'No'
  41. END
  42. END as [Notify Fax Incomplete Once],
  43. CASE
  44. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  45. ELSE CASE
  46. WHEN FUSR.SendNotify is NULL Then 'No'
  47. WHEN FUSR.SendNotify & 0x2 = 0x2 Then 'Yes'
  48. ELSE 'No'
  49. END
  50. END as [Notify Fax Incomplete Periodically],
  51. CASE
  52. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  53. ELSE CASE
  54. WHEN FUSR.SendNotify is NULL Then 'No'
  55. WHEN FUSR.SendNotify & 0x4 = 0x4 Then 'Yes'
  56. ELSE 'No'
  57. END
  58. END as [Notify Once During XMIT],
  59. CASE
  60. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  61. ELSE CASE
  62. WHEN FUSR.SendNotify is NULL Then 'No'
  63. WHEN FUSR.SendNotify & 0x8 = 0x8 Then 'Yes'
  64. ELSE 'No'
  65. END
  66. END as [Notify Periodically During XMIT],
  67. CASE
  68. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  69. ELSE CASE
  70. WHEN FUSR.SendNotify is NULL Then 'No'
  71. WHEN FUSR.SendNotify & 0x10 = 0x10 Then 'Yes'
  72. ELSE 'No'
  73. END
  74. END as [Notify XMIT Error will Retry],
  75. CASE
  76. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  77. ELSE CASE
  78. WHEN FUSR.SendNotify is NULL Then 'No'
  79. WHEN FUSR.SendNotify & 0x20 = 0x20 Then 'Yes'
  80. ELSE 'No'
  81. END
  82. END as [Notify XMIT Success],
  83. CASE
  84. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  85. ELSE CASE
  86. WHEN FUSR.SendNotify is NULL Then 'No'
  87. WHEN FUSR.SendNotify & 0x40 = 0x40 Then 'Yes'
  88. ELSE 'No'
  89. END
  90. END as [Notify XMIT permanently failed],
  91. CASE
  92. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  93. ELSE CASE
  94. WHEN FUSR.SendNotify is NULL Then 'No'
  95. WHEN FUSR.SendNotify & 0x80 = 0x0 Then 'Yes'
  96. ELSE 'No'
  97. END
  98. END as [Notify Fax Held for Preview],
  99. CASE
  100. WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
  101. ELSE CASE
  102. WHEN FUSR.SendNotify is NULL Then 'No'
  103. WHEN FUSR.SendNotify & 0x100 = 0x100 Then 'Yes'
  104. ELSE 'No'
  105. END
  106. END as [Notify Fax Held for Approval],
  107. FUSR.UserDIDNumber as [Incoming Fax Num],
  108. FUSR.AutoPrintFlags, FUSR.AutoPrintNetPrintID, FUSR.AutoSentPrinter, FUSR.DefaultPrinter,
  109. FUSR.HighestPriority, FUSR.DefaultPriority
  110. from Users as FUSR
  111. inner join Groups as FGRP
  112. on FUSR.GroupID = FGRP.handle
  113. Where FUSR.UserID not in ('RFINLUSER', 'Administrator', 'Default', 'Walkup')
  114. Order by FUSR.AutoPrintFlags
  115.  
  116.  
  117. /* Send Notify flags
  118. 0/1 Fax Incomplete Once only
  119. 0/2 Fax Incomplete Periodically
  120. 0/4 Fax Once During Transmission
  121. 0/8 Fax Periodically During Transmission
  122. 0/16 Fax Error will Retry
  123. 0/32 Fax Successfully Sent
  124. 0/64 Fax Permanent Fail
  125. 0/128 Fax Held for preview [0 = Send notification for held for preview ; 1 = no notification]
  126. 0/256 Fax Held for Approval [1 = Send notification for Needs Approval]
  127. */
  128.  
  129.  
Advertisement
Add Comment
Please, Sign In to add comment