I have a question regarding the documentation in BOL 2005 for the SUBSTRING function.
I've been toying around with nvarchar, and substring, and in the BOL, the SUBSTRING entry states that:
Is a positive integer that specifies how many characters or bytes of the expression will be returned. If length is negative, an error is returned. length can be of type bigint
It's just not very clear to me what the expression "characters or bytes" means... I'd want to know which one it is to be honest...
declare @a nvarchar(10)
set @a = N'üThis is a test'
if datalength(@a) >= 20 begin
set @a = substring(@a, 1, 7) + N'...'
I would have thought that my substring function would need 14 bytes as a length parameter, not 7 characters in order to truncate my expression. Could this be related to my regional settings?