select left(0x0a000b, 1) 返回字符串最左边的字符,即换行符.注意 select case when left(0x0a000b, 1) = 0x0a then 1 else 0 end 返回 1,这表明您确实正在获取换行符.有关其他详细信息,请参阅下面的评论.would someone please explain why select len(0x0a000b) returns 3? does len count bytes? and why select left(0x0a000b, 1) returns nothing? i expected 0x0a (if len counts bytes)...i am using mssql 2005thankskonstantin 解决方案 select len(0x0a000b) is returning the length of a string represented by the three bytes 0x0a, 0x00, and 0x0b.select left(0x0a000b, 1) returns the left-most character of the string, which is a newline character.Note that select case when left(0x0a000b, 1) = 0x0a then 1 else 0 end returns 1, which indicates you are, indeed, getting the newline character.Edit: Please see the comments below for additional details. 这篇关于varbinary 的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 09:50