Check if this script works on your server:
declare @table as table (A varchar(10))
insert @table values
('5GB'),
('50GB'),
('500MB'),
('1GB'),
('14GB'),
('11GB'),
('10GB'),
('102MB')
select * from @table
---
;
with Q as
(
select *, case when A like '%GB' then 1000 else 1 end as k, translate(A, 'MGB', ' ') as n
from @table
)
select replace(replace(A, 'GB', ' GB'), 'MB', ' MB') as A
from Q
order by n * k
or this:
select replace(replace(A, 'GB', ' GB'), 'MB', ' MB') as A
from @table
order by cast(replace(replace(A, 'MB', ''), 'GB', '000') as int)