Convert GUID to varchar(32)

前端 未结 1 1046
醉梦人生
醉梦人生 2021-02-19 09:37

How can I convert a GUID which is 36 characters to a VARCHAR(32)?

I\'m trying to copy data from one table to another. There are two similar columns from the

1条回答
  •  囚心锁ツ
    2021-02-19 10:03

    I assume this is SQL Server, from the SSMS tag.

    Convert the GUID to a string, then replace the hyphens with empty strings:

    REPLACE(CAST(table1.colx AS VARCHAR(36)),'-','')
    

    0 讨论(0)
提交回复
热议问题