Coding Horror - Custom Language


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. + '~0^0?0!' + CAST(t.int_priority_id AS VARCHAR(1))
  2. -- ~0 - do not notify when missed; ^0 - do not notify when complete; ?0 - should be completed by customer; !1or2 - required priority.
  3.  
  4. --and how it wil be parsed
  5. SUBSTRING(str_value, 1, charindex(':', str_value) - 1),
  6. NULLIF(SUBSTRING(str_value, charindex(':', str_value) + 1, charindex(';', str_value) - charindex(':', str_value) - 1), ''),
  7. NULLIF(SUBSTRING(str_value, charindex(';', str_value) + 1, charindex('~', str_value) - charindex(';', str_value) - 1), ''),
  8. SUBSTRING(str_value, charindex('~', str_value) + 1, charindex('^', str_value) - charindex('~', str_value) - 1),
  9. SUBSTRING(str_value, charindex('^', str_value) + 1, charindex('?', str_value) - charindex('^', str_value) - 1),
  10. SUBSTRING(str_value, charindex('?', str_value) + 1, charindex('!', str_value) - charindex('?', str_value) - 1),
  11. SUBSTRING(str_value, charindex('!', str_value) + 1, 8000)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.