--算法这样考虑,用固定表,加聚集索引提高速度,既然长度固定,用char加快查询速度--创建临时表
create table #t(code char(1) not null primary key)
insert into #t
select top 10 (select sum(1) from sysobjects where id<=a.id)-1 from sysobjects ainsert into #t
select top 26 char((select sum(1) from sysobjects where id<=a.id)+96) from sysobjects a
go--固定的组合表
create table tb(code char(12) not null)
alter table tb add constraint PK_tb PRIMARY KEY CLUSTERED (code)insert into tb 
SELECT 'www.'+a.code + b.code + c.code + d.code +'.com'
FROM #t a,#t b,#t c,#t d
go--查询的时候用:
select code from tb a left join 域名表 b on a.code=b.域名
where b.域名 is nullgo--删除处理用的表
drop table #t,tb

解决方案 »

  1.   

    这种数据库只有INTERNIC有呀,而且都是实时更新的.建议你找一个WHOIS查询控件,再来一个四位字母生成的过程(当然,你可以过滤掉一些无意义的,我曾经做过中间字母是 原因,首字母和末字母任意的三个字母的字符串产生过程),然后一个个的搜寻过去,如果返回结果是找不到匹配记录,那么说明这个域名确实是没有注册或者限制注册的,可以试试看啦.