[dba-SQLServer]Iif equivalent

Francisco Tapia fhtapia at hotmail.com
Sun May 4 00:12:57 CDT 2003


No offense Susan but you really ought to read the chapter in Martin's and
Your book specifically the chapter on writing sprocs... for Sql Server there
is NO Iif as in Access' Immediate If statement, but you could acheive the
same results using a case statement.  You could also expand the abilities of
your sproc by using a user defined function, but because that runs for every
single row of the returned data it will run slower (typically) than a case
statement, look up "Case" and "User Defined Function" in BOL, read that
sproc chapter from your book Sql From Access to Sql Server... again no
offense... :o)

-Francisco
http://rcm.netfirms.com/

On Saturday, May 03, 2003 1:27 PM [GMT -8],
Susan Harkins <harkins at iglou.com> wrote:

: I'm looking for an equivalent to Access' Iif() function -- can't seem
: to find anything -- is there one? In Access, you can use a quick
: expression in the form
:
: Iif(field=whatever,value,value)
:
: in a query to determine a field's content -- can you do the same in
: SQL Server?
:
: Susan H.
:
:



More information about the dba-SQLServer mailing list