Friday, April 2, 2021

Fastest C# compare string

 Use 


string.Equals(s1, s2, StringComparison.OrdinalIgnoreCase)


instead of toupper or tolower

Monday, February 8, 2021

Split sql with xml

https://stackoverflow.com/questions/697519/split-function-equivalent-in-t-sql/1846561#1846561


DECLARE @xml xml, @str varchar(100), @delimiter varchar(10)
SET @str = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15'
SET @delimiter = ','
SET @xml = cast((''+replace(@str, @delimiter, '')+'') as xml)
SELECT C.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as X(C)