Possible Duplicate:
How to compare software versions using SQL Server?
I am a complete and utterly new to sql, but today I found an error in a sql query here at work that is very important. So I could use some help:
Given an sql string that represents a product version
‘15.0.0.0’
is there a foolproof way to sort or compare that string similar to how .NET class System.Version compares instances?
So, given such a hypothetical construct, or function or what-ever, I would expect that ‘15.5.568’ would be greater than ‘15.0.0.0’.
Thanks
Assuming SQL Server, and a known maximum number of parts, here’s a user defined function that does the same as
parsename, but works on any number of parts:Example Usage:
http://sqlfiddle.com/#!3/e942b/3