復(fù)制代碼 代碼如下:
---涂聚文 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 server保存對(duì)象字符串轉(zhuǎn)換成uniqueidentifier失敗的問(wèn)題
- mysql unique key在查詢(xún)中的使用與相關(guān)問(wèn)題
- MySQL索引類(lèi)型Normal、Unique和Full Text的講解
- MySQL使用UNIQUE實(shí)現(xiàn)數(shù)據(jù)不重復(fù)插入
- mysql為字段添加和刪除唯一性索引(unique) 的方法
- Mysql中 unique列插入重復(fù)值該怎么解決呢
- 詳解Unique SQL原理和應(yīng)用