---塗聚文 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),@AreaUid Uniqueidentifier,@s varchar(200)
set @AreaUid='37A1DA94-4AC6-4ED0-B96F-BA3FE6AEACC8'
select @s=CONVERT(varchar(200),cast(@AreaUid as char(225)))
select @s
sql uniqueidentifier转换成varchar 数据类型
最新推荐文章于 2022-08-08 05:50:32 发布
本文探讨了在SQL中如何将唯一标识符转换为不同类型的字符串格式,包括使用CHAR和VARCHAR类型,以及如何在声明变量后进行赋值与选择操作。通过具体的代码示例,读者可以学习到如何有效地管理和展示数据。
1407

被折叠的 条评论
为什么被折叠?



