SQL Server | Convert Varchar to UniqueIdentifier By Clive Ciappara in #Programming November 7, 2010 2 Comments There are 2 ways to Convert a string to a UniqueIdentifier (GUID) in SQL Server: SELECT CAST(‘449141d9-86c9-449d-be2c-1f171b4f4567’ as UNIQUEIDENTIFIER) SELECT CONVERT(UNIQUEIDENTIFIER, ‘449141d9-86c9-449d-be2c-1f171b4f4567’) Share this post with your friendsFacebookTwitterLinkedIn
Hi, I have a question. Want to know which one will perform better when converting varchar to uniqueidentifier OR nvarchar to uniqueidentifier? Thanks in advance! Reply
thanks dude – you saved my bacon!
Hi, I have a question.
Want to know which one will perform better when converting varchar to uniqueidentifier OR nvarchar to uniqueidentifier? Thanks in advance!