[dba-SQLServer] Iif in SQL Server

Stuart McLachlan stuart at lexacorp.com.pg
Tue Sep 21 19:58:35 CDT 2004


On 21 Sep 2004 at 20:33, John W. Colby wrote:

> I have a situation where I need to have an iif construct that returns the
> contents of one field if it exists, else return the other field.  How do you
> do something like that in SQL Server?  Do I use a stored procedure?  I need
> this to run on potentially large datasets in something approaching real
> time.
> 

Take a look at CASE in BOL, it has several examples.

And - how about doing a bit of trimming. Your last post contains the 
contents of your previous 4 unrelated requests plus one response to one of 
them, followed by  5 sets of DBA signature blocks

(Of course, you don't get that sort of problem when people bottom post, 
they just naturally trim down to the relevant bits. <grin>)


-- 
Stuart





More information about the dba-SQLServer mailing list