Search notes:

SQL Server function: len

Trailing spaces

len does not count trailing spaces in a string (len('bar ')) returns 3 rather than 6!). A much better way to determine the length of a string seems to be datalengh().
print(len       ('foo'   )); -- 3
print(datalength('foo'   )); -- 3
print(len       ('bar   ')); -- 3 (!)
print(datalength('bar   ')); -- 6
print(len       ('   baz')); -- 6
print(datalength('   baz')); -- 6
Github repository about-MSSQL, path: /t-sql/functions/len/trailing-spaces.sql

See also

T-SQL functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206306, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL-Server/T-SQL/functions/len/index(46): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78