Tag Archives: TSQL

All date formats in one query

WITH N0 as (SELECT 1 as n UNION ALL SELECT 1) ,N1 as (SELECT 1 as n FROM N0 t1, N0 t2) ,N2 as (SELECT 1 as n FROM N1 t1, N1 t2) ,N3 as (SELECT 1 as n FROM … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

How to highlight searching words in text

Here is quick example how to highlight searching words using full text search in TSQL. It also avoids highlighting stop words /* Author: Andrew Butenko Create date: 14-01-2015 Description: highlight searching words in text including forms and excluding stop words Example: DECLARE … Continue reading

Posted in SQL | Tagged , | Leave a comment

How to clean text based on ASCII range

Ok, how can I clean my text with simple English symbols, let’s say from CHAR(10) to CHAR(125). In other words, if I have text “‘1,2,3…,4,5,•,6,ÿ,7′”, how can I get “1,2,3,4,5,,6,,7” ? Here is my approach: if text within 64K, it takes less than 1 second. … Continue reading

Posted in SQL | Tagged | Leave a comment