比如:把 userid=12,转化为u_00000000-0000-0000-0000-000000000012,
select 'u_'+'00000000-0000-0000-0000-'+RIGHT(CAST(cast(cast(0 as binary) as uniqueidentifier) as varchar(50))+CAST(字段 as varchar(50)),12)即可。
比如:把 userid=12,转化为u_00000000-0000-0000-0000-000000000012,
select 'u_'+'00000000-0000-0000-0000-'+RIGHT(CAST(cast(cast(0 as binary) as uniqueidentifier) as varchar(50))+CAST(字段 as varchar(50)),12)即可。