sql 随机生成中文名字
时间:2021-07-01 10:21:17
帮助过:3人阅读
DECLARE @fName TABLE(Id
INT IDENTITY(
1,
1)
PRIMARY KEY, NAME
NVARCHAR(
20))
-- 姓氏
2 DECLARE @lName TABLE(Id
INT IDENTITY(
1,
1)
PRIMARY KEY, NAME
NVARCHAR(
20))
-- 名字
3
4 INSERT @fName VALUES
5 (
‘赵‘),(
‘钱‘),(
‘孙‘),(
‘李‘),(
‘周‘),(
‘吴‘),(
‘郑‘),(
‘王‘),(
‘冯‘),(
‘陈‘),(
‘楮‘),(
‘卫‘),(
‘蒋‘),(
‘沈‘),(
‘韩‘),(
‘杨‘),
6 (
‘朱‘),(
‘秦‘),(
‘尤‘),(
‘许‘),(
‘何‘),(
‘吕‘),(
‘施‘),(
‘张‘),(
‘孔‘),(
‘曹‘),(
‘严‘),(
‘华‘),(
‘金‘),(
‘魏‘),(
‘陶‘),(
‘姜‘),
7 (
‘戚‘),(
‘谢‘),(
‘邹‘),(
‘喻‘),(
‘柏‘),(
‘水‘),(
‘窦‘),(
‘章‘),(
‘云‘),(
‘苏‘),(
‘潘‘),(
‘葛‘),(
‘奚‘),(
‘范‘),(
‘彭‘),(
‘郎‘),
8 (
‘鲁‘),(
‘韦‘),(
‘昌‘),(
‘马‘),(
‘苗‘),(
‘凤‘),(
‘花‘),(
‘方‘),(
‘俞‘),(
‘任‘),(
‘袁‘),(
‘柳‘),(
‘酆‘),(
‘鲍‘),(
‘史‘),(
‘唐‘),
9 (
‘费‘),(
‘廉‘),(
‘岑‘),(
‘薛‘),(
‘雷‘),(
‘贺‘),(
‘倪‘),(
‘汤‘),(
‘滕‘),(
‘殷‘),(
‘罗‘),(
‘毕‘),(
‘郝‘),(
‘邬‘),(
‘安‘),(
‘常‘),
10 (
‘乐‘),(
‘于‘),(
‘时‘),(
‘傅‘),(
‘皮‘),(
‘卞‘),(
‘齐‘),(
‘康‘),(
‘伍‘),(
‘余‘),(
‘元‘),(
‘卜‘),(
‘顾‘),(
‘孟‘),(
‘平‘),(
‘黄‘),
11 (
‘和‘),(
‘穆‘),(
‘萧‘),(
‘尹‘)
12
13 INSERT @lName VALUES (
‘爱‘),(
‘安‘),(
‘百‘),(
‘邦‘),(
‘宝‘),(
‘保‘),(
‘抱‘),(
‘贝‘),(
‘倍‘),(
‘蓓‘),(
‘本‘),
14 (
‘必‘),(
‘碧‘),(
‘璧‘),(
‘斌‘),(
‘冰‘),(
‘兵‘),(
‘炳‘),(
‘步‘),(
‘彩‘),(
‘曹‘),(
‘昌‘),(
‘长‘),(
‘常‘),(
‘超‘),
15 (
‘朝‘),(
‘陈‘),(
‘晨‘),(
‘成‘),(
‘呈‘),(
‘承‘),(
‘诚‘),(
‘崇‘),(
‘楚‘),(
‘传‘),(
‘春‘),(
‘纯‘),(
‘翠‘),(
‘村‘),
16 (
‘殿‘),(
‘丁‘),(
‘定‘),(
‘东‘),(
‘冬‘),(
‘二‘),(
‘凡‘),(
‘方‘),(
‘芳‘),(
‘昉‘),(
‘飞‘),(
‘菲‘),(
‘纷‘),(
‘芬‘),
17 (
‘奋‘),(
‘风‘),(
‘峰‘),(
‘锋‘),(
‘凤‘),(
‘芙‘),(
‘福‘),(
‘付‘),(
‘复‘),(
‘富‘),(
‘改‘),(
‘刚‘),(
‘高‘),(
‘阁‘),
18 (
‘铬‘),(
‘根‘),(
‘庚‘),(
‘耕‘),(
‘公‘),(
‘功‘),(
‘冠‘),(
‘光‘),(
‘广‘),(
‘归‘),(
‘桂‘),(
‘国‘),(
‘海‘),(
‘寒‘),
19 (
‘翰‘),(
‘昊‘),(
‘浩‘),(
‘荷‘),(
‘红‘),(
‘宏‘),(
‘洪‘),(
‘鸿‘),(
‘厚‘),(
‘华‘),(
‘存‘),(
‘大‘),(
‘丹‘),(
‘道‘),
20 (
‘德‘),(
‘登‘),(
‘砥‘),(
‘典‘),(
‘佃‘)
21
22 -- 生成名字
23 SELECT RTRIM((
SELECT NAME
FROM @fName WHERE Id
= Round(
Rand()
*(
100-1)
+1,
0)))
24 +RTRIM(
LTRIM((
SELECT NAME
FROM @lName WHERE Id
= Round(
Rand()
*(
100-1)
+1,
0))))
25 +RTRIM(
LTRIM((
SELECT NAME
FROM @lName WHERE Id
= Round(
Rand()
*(
100-1)
+1,
0))))
AS 名字
sql 随机生成中文名字
标签: