随机产生用户名
来源:互联网 发布:js shift 多选 编辑:程序博客网 时间:2024/06/05 21:56
declare @firstNames varchar(max) /* 保存名的集合 */
declare @lastNames varchar(max) /* 保存姓的集合 */
set@firstNames='芳,海,亮,红,君,军,俊,江,河,湖,波,杰,山,燕,阳,洋,涛,斌,彬,宾,微,伟,威,薇,刚,倩'/* 必须只有一个字 */
set @lastNames = '刘,方,王,李,赵,孙,钱,胡,易,黄,温,丁,周,魏,陈,曾,涂' /* 必须只有一个字 */
declare @lastNamesLength int
declare @firstNamesLength int
set @lastNamesLength = (LEN(@lastNames) - 1) / 2 + 1
set @firstNamesLength = (LEN(@firstNames) - 1) / 2 + 1
declare @firstNameRandom int
declare @lastNameRandom int
declare @resultFullNames varchar(max)
set @resultFullNames = ''
declare @i int
set @i = 1
while(@i <= 1000)
begin
set @firstNameRandom = CEILING(rand()*@firstNamesLength)
set @lastNameRandom = CEILING(rand()*@lastNamesLength)
/*
产生第 1 个字,对于的 Index 为 1,注意:这里的 Index 最小值为 1。
产生第 2 个字,对于的 Index 为 3,
产生第 3 个字,对于的 Index 为 5,
...
*/
set @resultFullNames = @resultFullNames + ( SUBSTRING(@lastNames, @lastNameRandom * 2 - 1, 1) + SUBSTRING(@firstNames, @firstNameRandom * 2 - 1, 1) + ',' )
set @i = @i + 1
end
print @resultFullNames
declare @lastNames varchar(max) /* 保存姓的集合 */
set@firstNames='芳,海,亮,红,君,军,俊,江,河,湖,波,杰,山,燕,阳,洋,涛,斌,彬,宾,微,伟,威,薇,刚,倩'/* 必须只有一个字 */
set @lastNames = '刘,方,王,李,赵,孙,钱,胡,易,黄,温,丁,周,魏,陈,曾,涂' /* 必须只有一个字 */
declare @lastNamesLength int
declare @firstNamesLength int
set @lastNamesLength = (LEN(@lastNames) - 1) / 2 + 1
set @firstNamesLength = (LEN(@firstNames) - 1) / 2 + 1
declare @firstNameRandom int
declare @lastNameRandom int
declare @resultFullNames varchar(max)
set @resultFullNames = ''
declare @i int
set @i = 1
while(@i <= 1000)
begin
set @firstNameRandom = CEILING(rand()*@firstNamesLength)
set @lastNameRandom = CEILING(rand()*@lastNamesLength)
/*
产生第 1 个字,对于的 Index 为 1,注意:这里的 Index 最小值为 1。
产生第 2 个字,对于的 Index 为 3,
产生第 3 个字,对于的 Index 为 5,
...
*/
set @resultFullNames = @resultFullNames + ( SUBSTRING(@lastNames, @lastNameRandom * 2 - 1, 1) + SUBSTRING(@firstNames, @firstNameRandom * 2 - 1, 1) + ',' )
set @i = @i + 1
end
print @resultFullNames
- 随机产生用户名
- 用ASCII的方法产生随机用户名或密码
- C#随机生成用户名
- 随机产生用户密码
- 随机产生用户密码
- java 随机产生字符串
- 随机产生一个中文
- C# 产生随机字符串!
- java随机产生字符串
- 随机产生一个字符串
- 产生随机颜色
- java 随机产生字符串
- 产生随机字符串
- 随机产生链表小程序
- vc产生随机字符
- 产生随机验证码
- 随机产生字符串函数
- 产生随机卡号
- make工具及makefile规则 |from document .
- Android 简单异步处理类------实现声音的录制及播放
- Java SE 6 生命将在今年11月终结
- Project interpreter not specified(eclipse+pydev)
- linux 开机自启脚本
- 随机产生用户名
- poj2002 hash
- 如何由IP地址反向查询自治域号
- qt移植出现Segmentation fault
- MYGUI Generic factory
- jQuery 循环图片滚动切换效果代码
- 在实现一个WIFI无线连接设置中需要注意的问题
- java.util.concurrent-------TimeUnit
- C#中调用非托管的DLL及参数传递 (一)