How to convert varchar to uniqueidentifier in SQL Server
By FoxLearn 2/16/2024 4:39:20 AM 64
This post shows you how to convert varchar to uniqueidentifier in SQL Server.
For example:
id: a79b1ecd95015ae6b9c8aabb07da1020
To convert varchar to uniqueidentifier you can use the sql query as shown below.
SELECT CONVERT(uniqueidentifier,STUFF(STUFF(STUFF(STUFF('a79b1ecd95015ae6b9c8aabb07da1020',9,0,'-'),14,0,'-'),19,0,'-'),24,0,'-'))
Result
A79B1ECD-9501-5AE6-B9C8-AABB07DA1020
- SQL Server Migration Assistant
- How to Download and Restore Northwind database to SQL Server
- How to use SQL INSERT INTO SELECT Statement
- Data type SQL Server
- How to drop table if exists in sql server
- How to fix 'The specified directory for the INSTALLSHAREDDIR parameter is not valid'
- How to get all table names of a particular database using TSQL
- How to use ROW_NUMBER Function in SQL Server
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024
What Are RESTful Web Services?
02/19/2024