加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

uniqueidentifier转换成varchar数据类型的sql语句

发布时间:2020-12-12 09:29:07 所属栏目:MsSql教程 来源:网络整理
导读:div class="codetitle" a style="CURSOR: pointer" data="684" class="copybut" id="copybut684" onclick="doCopy('code684')" 代码如下:div class="codebody" id="code684" ---涂聚文 Geovin Du DECLARE @myid uniqueidentifier SET @myid = NEWID() SELECT

<div class="codetitle"><a style="CURSOR: pointer" data="684" class="copybut" id="copybut684" onclick="doCopy('code684')"> 代码如下:<div class="codebody" id="code684">
---涂聚文 Geovin Du
DECLARE @myid uniqueidentifier
SET @myid = NEWID()
SELECT CONVERT(char(255),@myid) AS 'char';
GO
--涂聚文 Geovin Du
declare @allstring char(255),@AreaUid Uniqueidentifier
set @AreaUid='37A1DA94-4AC6-4ED0-B96F-BA3FE6AEACC8'
set @allstring= cast(@AreaUid as char(255))
select @allstring
--涂聚文 Geovin Du
declare @allstring char(255),@AreaUid Uniqueidentifier,@s varchar(200)
set @AreaUid='37A1DA94-4AC6-4ED0-B96F-BA3FE6AEACC8'
set @allstring= CONVERT(char(255),@AreaUid)
set @s=cast(@allstring as varchar(200))
select @allstring,@s
--涂聚文 Geovin Du
declare @allstring char(255),@s varchar(200)
set @AreaUid='37A1DA94-4AC6-4ED0-B96F-BA3FE6AEACC8'
select @s=CONVERT(varchar(200),cast(@AreaUid as char(225)))
select @s

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读