Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty() function in SQL Server??
Message
 
 
À
29/04/2013 16:35:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01572208
Message ID:
01572215
Vues:
64
You don't need LEN() function.
field = '' 
It will work in VFP as well with SET ANSI ON.

and no, LEN() function will not be expensive because it's built in

>So, would
>
>Len(field) = 0
>
>be expensive since this is a built in function in Sql Server?
>
>
>
>>UDFs are very expensive in queries in VFP and SQL Server. You have to have a good reason to use them
>>
>>>Shouldn't it be possible to add a custom function in Sql Server so that I could still use Empty([feildname]) in an expression?
>>>
>>>
>>>Select 
>>> Case When Empty(Activejobitems.part_no) Then
>>>   Activejobitems.description
>>> Else  Activeparts.description End as description
>>>From JobItems
>>>Activejobitems  Inner Join Jobs Activejobs On Activejobitems.job_num = Activejobs.job_num
>>>Left Outer Join parts Activeparts On Activejobitems.part_id = Activeparts.id  Inner
>>>Join schedule On Activejobitems.job_num = ScheduleRecords.job_num
>>>Inner Join machines On ScheduleRecords.mach_num = Machines.mach_num
>>>Where ScheduleRecords.mach_num = '   ' AND
>>>  ScheduleRecords.status <>  'C'  AND
>>>  Activejobs.status =  'A'
>>>Order By [ScheduleRecords].[mach_num] , [ScheduleRecords].[order_mach]
>>>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform