SQLServer生成三位姓名及11位國內電話號碼(生成測試數據用)

SELECT 
  SUBSTRING(N'王李張劉陳楊黃趙吳周徐孫馬朱胡郭何高林鄭謝羅梁宋唐許韓馮鄧曹彭曾肖田董袁潘於蔣蔡餘杜葉程蘇魏呂丁任沈姚盧姜崔鍾譚陸汪範金石廖賈夏韋付方白鄒孟熊秦邱江尹薛閆段雷侯龍史陶黎賀顧毛郝龔邵萬錢嚴覃武戴莫孔向湯',
  (ABS(CHECKSUM(NewId()))%100+1),1)+nchar(cast(19968+(CAST((ABS(CHECKSUM(NewId())) % 99999) AS FLOAT) / 5) as int))+
  nchar(cast(19968+(CAST((ABS(CHECKSUM(NewId())) % 99999) AS FLOAT) / 5) as int)) AS CNAME,
  '1' + SUBSTRING('358', ABS(CHECKSUM(NewId())) % 3 + 1, 1) + CAST(ABS(CHECKSUM(NewId())) % 9 AS VARCHAR) + left(CAST(ABS(CHECKSUM(NewId())) AS VARCHAR),8) AS TEL

名字部分有很多生僻字,不過測試數據的話,勉強用用吧測試

相關文章
相關標籤/搜索