SQL

You are currently browsing articles tagged SQL.

DATALENGTH returns the length of the string in bytes, including trailing spaces. LEN returns the length in characters, excluding trailing spaces. For example,

SELECT
  LEN('string'),
  LEN('string   '),
  DATALENGTH('string'),
  DATALENGTH('string   '),
  LEN(N'string'),
  LEN(N'string   '),
  DATALENGTH(N'string'),
  DATALENGTH(N'string   ')

will return 6, 6, 6, 9, 6, 6, 12, 18

from Arnold Fribble
Ref : SQLTeam

Tags: , , ,

it’s make very trouble for me. i try to collect my problem.

Read the rest of this entry »

Tags: , , ,