I can't say this is a suitable task for SQL Server, but it is achievable nonetheless.
First, you need to create the mapping table that contains all the characters you want to see in your URLs:
declare @charmap table (
Id tinyint identity(0,1) primary key,
Letter char(1) collate Latin1_General_BIN not null unique
);
insert into @charmap (Letter)
select top (26) char(row_number() over(order by (select null)) - 1 + ascii('A'))
from sys.all_objects ao
union all
select top (26) char(row_number() over(order by (select null)) - 1 + ascii('a'))
from sys.all_objects ao
union all
select top (10) char(row_number() over(order by (select null)) - 1 + ascii('0'))
from sys.all_objects ao;
In this example, I used a table variable to minimise the impact. You can turn it into a static table, of course; in that case, it only needs to be populated once.
Now, the following query will generate the specified number of codes all having the same desired length. First two variables control that:
declare @BatchSize int = 1000,
@Length int = 7;
select h.RndHex,
replace(
(select cm.Letter as [data()] from (
select top (datalength(h.RndHex)) row_number() over(order by (select null)) as [RN]
from sys.all_objects ao
) ca
inner join @charmap cm on cm.Id = cast(substring(h.RndHex, ca.RN, 1) as tinyint) % 62
order by ca.RN
for xml path('')
), ' ', ''
) as [ShortURL]
from (
select top (@BatchSize) crypt_gen_random(@Length) as [RndHex]
from sys.all_objects a, sys.all_objects o
) h;
Technically, 5 characters will give you power(62., 5)
~=916 million of unique combinations. However, you might want to increase code length in order to make them harder to guess. That's why my sample generates 7-character codes - for 100 million combinations used, it will provide about 35000 possible combinations per every one which was actually generated.
On the other hand, if guessability isn't an issue for you, you can keep codes' length at a minimum, which is 5 characters in your case.