[dba-SQLServer] Appending strings where there are nulls

Paul Nielsen pauln at sqlserverbible.com
Wed Mar 19 18:52:55 CDT 2008


Yes, IsNull() in building strings in the output columns is very fast. Using
IsNull() on a column in the where clause is slow. 

-Paul 

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Wednesday, March 19, 2008 5:30 PM
To: 'Discussion concerning MS SQL Server'
Subject: Re: [dba-SQLServer] Appending strings where there are nulls

LOL, the OhNoSecond strikes again.  One answer is
ISNULL(Value,'ReplacementValue').

Now whether this will work for a million records in near real time is
another question. 


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Wednesday, March 19, 2008 7:12 PM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] Appending strings where there are nulls

I am trying to build up a street address from a set of fields.  Any given
field may have a null.  If I just use + then anywhere there is a null in the
source I get a null as a result.  

What is the syntax to append fields to build an aliased field but avoid the
null issue?

John W. Colby
Colby Consulting
www.ColbyConsulting.com 

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com


__________ NOD32 2960 (20080319) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com





More information about the dba-SQLServer mailing list