数据库
首页 > 数据库> > MSSQL 随机数+指定字符串截取

MSSQL 随机数+指定字符串截取

作者:互联网

    declare  @User_CodeV nvarchar(500) ,  @User_Pwd  nvarchar(500) 
                        , @User_Name nvarchar(500) 
                            , @RndId nvarchar(500) ,@identity numeric(18,0)
                              select  @RndId =cast(ceiling(rand(checksum(newid()))*10000) as int)   
                        select   @User_CodeV='BI_her2'                            ,  @User_Pwd=left(   @User_CodeV,       charindex('_',@User_CodeV)-1) +@RndId ,@User_Name=''  

 

标签:RndId,CodeV,截取,MSSQL,select,User,随机数,nvarchar,500
来源: https://www.cnblogs.com/panjinzhao/p/16649402.html