Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you do this in SQL Server 2000?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00740729
Message ID:
00740733
Vues:
11
>SELECT iif(isempty(field1),0,1) as myfield FROM mytable
>
>I want to use IIF and isempty in SQL 2000

There's no empty() function in Sql Server. For character field you can use LEN(myfiled) = 0 to check if it's empty. CASE function can be used in place of IIF(). It's even better than IIF() because you can check multiple conditions w/o embeded calls to CASE function.
SELECT CASE WHEN LEN(filed1)=0 THEN 0 ELSE 1 END AS myfield ;
  FROM mytable
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform