Disclaimer: I am a consultant at Amazon Web Services, and this is my personal blog. The opinions expressed here are solely mine and do not reflect the views of Amazon Web Services (AWS). Any statements made should not be considered official endorsements or statements by AWS.
To check bytes used by a variable in SQL Server, you can use DATALENGTH
function.
DECLARE @temp NVARCHAR(MAX)
SET @temp = N'化字'
SELECT DATALENGTH(@temp)
This will display the number of bytes used @temp
variable to represent a character or expression.