The information in this article applies to:
SUMMARYThe following information discusses how NULLS, null strings, and blank strings are handled in SQL Server. MORE INFORMATION
SQL Server automatically strips trailing blanks from character strings
before storing the string if the data type is VARCHAR, or if the data
type is CHAR and nulls are allowed. A trailing blank that is also the
first character in the string is not stripped. Trailing blanks are
preserved if the data type is CHAR and nulls are not allowed.
If the data type is CHAR (fixed length) with nulls allowed, the trailing blanks that were stripped are not restored by DB-Library (DB-Lib). For example, if a column is defined as CHAR(10) NULL and if ('rec1 ') is inserted, the dbdatlen() function will return 4. If the column is defined as CHAR(10) without nulls allowed and the same data loaded, the dbdatlen() function will return 10. Additional query words: Transact-SQL dblib Windows NT
Keywords : kbprg SSrvDB_Lib SSrvTran_SQL SSrvWinNT |
Last Reviewed: March 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |