Borge Hansen
pcs.accessd at gmail.com
Mon Jul 7 19:03:31 CDT 2008
Hi, A very simple one: What is 'best practise way' of handling something like the following in a select sp or view: t.StreetNrPOBox + ', . . . ' + t.StreetName + ', . . . ' + t.Suburb + ', . . .' as xyz where one of the column values may be null ?? MS Help in BOL is again not very helpful ... (topic: concatenation [SQL Server] ) They talk about ..Just like arithmetic operations that are performed on null values, when a null value is added to a known value the result is typically an unknown value, a string concatenation operation that is performed with a null value should also produce a null result. However, you can change this behavior by changing the setting of CONCAT_NULL_YIELDS_NULL for the current session. For more information, see SET CONCAT_NULL_YIELDS_NULL (Transact-SQL). Then for SET CONCAT_NULL_YIELDS_NULL { ON|OFF } the first thing you read is: Important: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. So, what's best practise here: a) Don't allow null in any text fields in your table definitions? b) use a case statement to test for null c) ?