November 25, 2009 at 3:35 am
Hi,
I have a question related with NULLs.
Can you please help?
Thanks in advance.
My question is (when SQL Server installed with the default options) how does SQL Server 2005 behavior is , in this case:
if test1 returns Null, the result of the select will be null, correct?
e.g:
select test1+isnull(test2,'')
question:
If i concatenate a null value with some other value (not null), will the result allways be a null?
November 25, 2009 at 4:35 am
November 25, 2009 at 4:52 am
thanks for the tip.
November 25, 2009 at 5:35 am
Note that the option will be removed from a future version of SQL.
IMO if you have a nullable field in a concatanation then you should always stick isnulls round each part.
November 25, 2009 at 6:42 am
Will that be removed allready in SQL Server 2008?
Or only in future versions?
Thank you
November 25, 2009 at 6:50 am
Pass, the link to the technet site seems to be for 2005 documentation, so there is a chance its been removed from 2008 although i dont have a 2008 server to test on.
November 25, 2009 at 7:41 am
Use COALESCE to get rid of null values.
November 25, 2009 at 3:15 pm
dba_pkashyap (11/25/2009)
Use COALESCE to get rid of null values.
Why? Is it because you believe in the myth of portability? Unless I have more than 1 operand to check for a null value, I use ISNULL in SQL Server because it's faster than COALESCE. Most people won't notice the difference but my batches consist of queries on tables where each table will contain millions of rows. Shoot, I've got "simple" lookup tables that necessarily consist of more than 500,000 rows and every microsecond saved on a row works out to be a substantial savings on the batches.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply