Technical Article

sp to transform a UniqueIdentifier to a String

,

Uses the system relatively Undocumented sp
sp_MSguidtostr  to do the conversion from a GUID to a string

DECLARE @guid uniqueidentifier, @guidstr sysname
SET @guid=NEWID()

EXEC sp_MSguidtostr @guid, @guidstr OUT
SELECT @guidstr, convert(sysname, @guid)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating