According to this link, Sqlserver cancels the first 3 sections, so you need to do:
hextoraw(substr(guid,7,2)|| substr(guid,5,2)|| substr(guid,3,2)|| substr(guid,1,2)|| substr(guid,12,2)|| substr(guid,10,2)|| substr(guid,17,2)|| substr(guid,15,2)|| substr(guid,20,4)|| substr(guid,25,12) )
(guid is like "BBD098BF-58F0-4A84-90C2-F806D6D06061")
source share