Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF in SqlServer and Overview for SQL server Functions
Message
De
25/06/2003 10:36:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00803735
Message ID:
00803785
Vues:
13
Patrick,

>1 - I am searching for something in SqlServer that is similar to IIF in the Fox syntax. I need to retrieve a string via SqlExec from Sql-Server where one field should be composed by RTRIM(firstname)+RTRIM(Lastname) and in between a space "IIF" firstname is empty.

Others have pointed you to the CASE command in T-SQL, which can be used in the SELECT statement. In addition, you can create User-Defined Functions (UDFs) in SQL Server for functions, calculations, tests, and other conditional processing that you might want to reuse in multiple queries.

Dan Jurden's whitepaper takes you through the details of how to do that:

http://www.eps-cs.com/pdf/whitepaper_sqlUDFs.pdf
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform