You should be able to pass your USER agent data and replace it with this It would be very helpful if someone could explain a solution for this issue. I spent too much time to figure out a solution for doing it, but I couldn't. WHEN Charindex('Safari', useragent) > 0 THEN 'Safari'Īt first glance, it is very easy, but as you can see in sqlfiddle, the result is not true because the last record has Chrome and it is categorized in Chrome category. WHEN Charindex('Chrome', useragent) > 0 THEN 'Chrome' OR Charindex('MSIE', useragent) > 0 THEN 'IE' WHEN Charindex('Edge', useragent) > 0 THEN 'Edge'
WHEN Charindex('Firefox', useragent) > 0 THEN 'Firefox' I want to categorize records to 6 categories like below:
UserAgent was filled by erAgent client users. I have a table like below: create table SiteLog (UserAgent nvarchar(255))