Experts Exchange connects you with the people and services you need so you can get back to work.
CREATE FUNCTION fnCharToUCSHex(@input varchar(max))
DECLARE @position int, @asciicode int, @ResultVar varchar(max), @hex varbinary(2)
SET @ResultVar = ''
SET @position = 1
WHILE @position <= DATALENGTH(@input)
SET @asciicode = ASCII(SUBSTRING(@input, @position, 1))
SET @position = @position + 1
SET @hex = CONVERT(VARBINARY(2), @asciicode)
SET @ResultVar = @ResultVar + Right(master.dbo.fn_varbintohexstr(@hex), 4)
Open in new window
The older UCS-2 (2-byte Universal Character Set) is a similar character encoding that was superseded by UTF-16 in version 2.0 of the Unicode standard in July 1996.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $159.20.
Premium members get this course for $49.99.
Premium members get this course for $389.00.
Premium members get this course for $62.50.
Premium members get this course for $31.25.
Premium members get this course for $148.75.