• SQL Server如何获取GUID号


    select newid() guid;--获取GUID

    select replace(newid(),'-','') guid;--获取GUID 去掉-

    sqlserver newid()函数 

    NEWID (Transact-SQL) - SQL Server | Microsoft LearnNEWID (Transact-SQL)icon-default.png?t=M85Bhttps://learn.microsoft.com/en-us/sql/t-sql/functions/newid-transact-sql?redirectedfrom=MSDN&view=sql-server-ver16

    如何一次获取100个GUID号?

    1. --创建临时表
    2. drop table test;
    3. create table test(id VARCHAR(100) not null,CONSTRAINT pk_test PRIMARY KEY (id));
    4. --执行循环插入
    5. declare @i int
    6. set @i=1
    7. while @i<=100
    8.     begin
    9.     insert into test (id) values(replace(newid(),'-',''))
    10.     print @i
    11.     set @i=@i+1
    12. end
    13. --查询结果
    14. select * from test;

    执行结果如下:

    id                               
    -------------------------------- 
    000E5D4B9C204C1897A15B9FA2E2CB48 
    0497AD73FED6498C9751367E2D9D018E 
    05FAB09587EB450DAABE1EAD6E271BB5 
    09D41F2972B7470E927B3574E82E43C2 
    0A2587AD99F94AE997FA59CB0079AD57 
    0CEB006236164F78B78E4E60D0708B84 
    0D52C244E06B4B019515C47D246D3C43 
    0FE54E5264FE4F958D0F674C3C3309D6 
    1499138A5F5E4EE39A6FCD0224688FF6 
    150538BCCD3F49D3AE391B5D1D838532 
    15A4D97EFA8C4027BAFA17AB85C10CF4 
    197A9584229045B487F7128B0A5B3FF3 
    19F705BB3CAF45A8B2789B06641B2587 
    1A5285196C674F8C940D91291155790F 
    1A960F45A7B546FD9C7B56D83F9DCBA2 
    1F43355572B54C5F8457B95B5F988055 
    240CD676D49A4564A00468C71D56CFCD 
    24FDC1BDF6AF4B6A8FA2619EA7758A28 
    2A8B51292D8D4FE183D56D51AB5E3525 
    2BBD9C47451E4ACDBFFACFC401950AED 
    3332C420162447598D2FA3DC153BC134 
    3494590AC69147A28E864AB19B9D4467 
    34AD32E2ABA8448C95CB7A5CFD739809 
    3AECAA29E9494AA6A6CBC9FC8B73FA43 
    3CAB0CB182C94D12AC4B841B2BE3DC8D 
    4178809AD36C42D894DCC4F89B2CEA8A 
    4207DA66DFEF49D4B72804DB1CC67036 
    43C77875A7864E2580D79508BE70293F 
    43D57DE7EE8949B9BDB5DAAF1C1D1859 
    4843B76F380D4B359513BAD2AEA755F3 
    4E237F99CC2140FEB65C5F986154D14F 
    4EAFC491B86D4639AA340DE76FF74B36 
    52F821B02F4B4E0AAB0B4B7A3DEFD00C 
    56D4DA2A2E5C4C81A18373DFC6FD092F 
    5E1FEF8B6BE74D92A6B3EB233983FD7C 
    5EFD6336418345A48249CE0304079E3A 
    61DD4D2AB5FC43E2B0CDEC3C046FDCD0 
    66C8433590D54279BE93A265E901F455 
    68B55AC32B244711A52BE4486B0CC969 
    6ED1018F915F4F3BAAD5B38A791AD692 
    71457877E432472BA961F1DD5825335C 
    7312ACE7630640D7BB02AF5C5ACA999D 
    774E61C459C442D8902BC9F49CD766D1 
    7C4BA29BD9E8447EB7B42E7DBB5D42A8 
    7E607F0AC25747EAB9AF6E0BE25D9025 
    8113901FAF47410DB8331874AD0218E0 
    8259E310C72144D0B93C6FA04BABE7AF 
    83EEBCE14ADF4C518362965C39F5ED8D 
    8CD0C65810564C368CD0DB1B0DBC2F25 
    8D27AF7CF0A6400EB97D5ECD50F1C95B 
    8DA7977AF62744D3A6AF97E20CE62F57 
    96F65FC6133E4CA3AC1BFE13863E1E28 
    97BB77520F1F49AC8EE1C5386E92845A 
    9860744B9E8D482B9CDA3F653BEE6775 
    9880DBE72E7744B98203A7DFECDD8F68 
    9B2B45E3C337458FA6A9649A8EEC6ABE 
    9D20F58B4B0E4F329E6D8F97DCCCE7F6 
    9E4781195DFE4D1A9A406D5586207F92 
    A1DC69AEEDBE45BAB6003B7A3080B422 
    A25DBE956EBE488691E3937FA794E9E8 
    A282348F0BF54671B62C5971E2E87869 
    A2E8C5C0BAB34E029200DCC40D2EB53B 
    A3E2AED39F2D4EFE8ECB43656C78F0E3 
    A83AB5D8E9834D64A885942F2A73C5B0 
    B4A43F0DB6F24091B0C66BF628720481 
    B57EB0F3EDA943439B6D1A7069D99A35 
    B742451B3F3440BEA5E8AF19F9C88DBB 
    B775E639BAED4AE5860383FC6B017508 
    B80248F89CA24D2AA3F1C0EC34F7A80B 
    B9596FE0040842F4ABFD3E0D7D0113D7 
    BB66D4B73BE34367BC982063D048DF5D 
    BC48143009CF4F0DA9524FFECDBCDD67 
    BCAF080D206D45FA92121088D451E67E 
    BE71526D06E1427D857B422901E42582 
    C125BBC2B18A49E192FA4DAEA2E5E580 
    C54ECB8CB471468BB9F4BCF44B80D142 
    C7816B646FA445158132C58485BDD10E 
    C79634234E1242B8BEA55D824A76D504 
    CC9149449D6345DA95D3787C985643FE 
    CD1D801B9EBC49398ED712D8D0F4F9F7 
    CD8082E2D4024776BD3E926D10A706B7 
    CE56D93011294AEBA4DD381094C1FCEA 
    CFBA18DB1DC04A73A4F88BA885787EA3 
    D28F7A444E6541E8935E751F5800F032 
    D64EDBEEF2AF476B94E4CEEE42ACB94B 
    DBFEBA8CEFFD442FA4ACA6821DAFF3D1 
    DC3B8C53E6E24C2492425BC089FC3BB6 
    E431ECA116B84F379547335B391EE721 
    E4640378DA75467D8E39214B408667C5 
    E903C0ED7D9B4E0AA194BCE2E4ABE386 
    EABF02BB805D45D989A212DAAB9D6C30 
    ED37686BC5704B1CB6E09D740AC96CE0 
    EE886645FF584A5BA3DD3B9C2B7A7A19 
    F0699BF56F23461DBD309BD1EF0385AB 
    F0E0FA6AD5FC4364B3B605D71A0F39E2 
    F17F8D7C9B3D40469F684F5989472CD2 
    F5A61B6A6B9741C9806D1BB19233EBD0 
    F89E69595AA3421B81AD51E7717C58E5 
    FCBAA297CDC94D31AF73AD9521F2076A 
    FD9CBEDD8A514A40A1807FE7B848B9B5 

     

     

  • 相关阅读:
    增加Linux用户
    reactHook实现EventBus
    vue学习总结
    三大云厂商 ARM 架构服务器性能对比
    【翻译】Efficient Data Loader for Fast Sampling-Based GNN Training on Large Graphs
    k8s2-4控制器操作指令
    Redis数据结构:集合
    MongoDB - readConcern
    数据结构(栈和队列)
    Semaphroe + CountDown
  • 原文地址:https://blog.csdn.net/ChailangCompany/article/details/128036227