Len() vs datalength() in SQL Server 2005

前端 未结 6 939
失恋的感觉
失恋的感觉 2020-12-08 19:36

Recently I faced a issue when using len() in a query to find out the length of a query, len() was not counting the trailing spaces in the value. Bu

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 20:10

    Be careful. DATALENGTH returns the number of bytes used, not the number of characters.

提交回复
热议问题