Actually the swap char will not always are char 3 and 4 and last 2 chars.
For example it may also be like this :
Input: " abcdkazbmopdkubmgt "
The wanted result is : "abckdazmbopkdumbgt"
Input and wanted result length are same.
BUT the input string length is not always the same.
Very hard to solve this. Tq.
If you think it will do what you need you can write a function in C# or VB and add it to SQL Server (I assume you're using SQL Server). As to how to add it to SQL Server, I'd rather write a tip than post it here.
Given that the function has the signature int Levenshtein ( string , string ) you would then be able to say:
SELECT * FROM sometable WHERE dbo.Levenshtein ( somefield , @somevalue ) < @somethreshold
The threshold should probably be based on the lengths of the strings, for instance half the length of the shorter string.
To make things more efficient, you could write a function with the signature bool IsSimilar ( string , string , int ) that will return false as soon as the Levenshtein Distance between the strings exceeds the threshold (the third parameter).
SELECT * FROM sometable WHERE dbo.IsSimilar ( somefield , @somevalue , @somethreshold ) = 1
Hi everyone! I need to know the maximum number of concurrent connections to SQL Server 2008. When I check from Server properties in Management Studio, it is set to zero with a text description that zero means unlimted connections.