[dba-SQLServer] Iif in SQL Server

John W. Colby jwcolby at colbyconsulting.com
Tue Sep 21 20:38:48 CDT 2004


>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


Sorry, my Outlook is totally screwed up with two sets of address books, one
of which works, the other doesn't.  Haven't had time to look at why, but as
a result in order to post I just grab an email and reply.  I try to trim up
to my sig but sometimes I forget.

John W. Colby
www.ColbyConsulting.com 

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Tuesday, September 21, 2004 8:59 PM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] Iif in SQL Server


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