I have a table that stores the versions as under
Declare @tblVersion table(VersionNumber varchar(100)) Insert into @tblVersion Values(\'1.3.1\') Insert int
If you are using SQL Server 2008 or later, you can leverage the hierarchyID data type:
select * from @tblVersion order by CAST('/'+REPLACE(VersionNumber,'.','/')+'/' as hierarchyID)