Using IIF in query for Linked Tables SQL Server 2012 (1 Viewer)

Rx_

Nothing In Moderation
Local time
Today, 05:13
Joined
Oct 22, 2009
Messages
2,803
In SQL Server 2012, the T-SQL languaged added the IIF. The IIF is actually a wrapper that converts to a T-SQL Case statement during runtime.

My SQL Server is 2008R2. The IIF is not part of the T-SQL language.
My MS Access 2010 uses a DSN-Less connection using SQL Server Native Client 11.0 (the latest one for SQL Server 2013).

Does the ODBC (Native Client) translate the IIF in an Access Query into a Case statement for the SQL Server side?

For speed purposes, I am trying to determine if to invest the overhead in re-writing Stored Procedures with Case statements - or if the ODBC is doing the job for me anyway?
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 22:13
Joined
Jan 20, 2009
Messages
12,849
Yes. ODBC does the translation.

A stored procedure on the server will be slightly faster because it has a stored execution plan. However you probably won't notice the difference on a lightly loaded server.

Eliminating the need to build the execution plan is more important for reducing the load on a busy server.
 

Rx_

Nothing In Moderation
Local time
Today, 05:13
Joined
Oct 22, 2009
Messages
2,803
Thanks for the confirmation.
It is what I expected, and I incidently won the bet.
If you get to visite the topside, I owe you half the winnings (a cup of coffee).
 

Users who are viewing this thread

Top Bottom