Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using * in sqlselect
Message
From
12/04/2003 11:20:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00776918
Message ID:
00776951
Views:
29
>I wonder whats best, to specify every field in an sqlselect, or use a * (a "star", I dont know the english word).

The usual English word for the star is "asterisk".

>Example:
>I make a select and join 2 tables. Table 1 has 40 fields and table 2 has 40 fields. I need 35 fields from each table. (I send the select command to a SQL2000 server)
> ...

To simplify your coding can be a very important consideration. On the other hand, having too many fields can sometimes be a problem for debugging.

If speed is critical, you should do some speed tests, which is actually faster. Especially if you select from a VFP table, I think there is no guarantee that selecting less fields will actually be faster than selecting all fields.

From SQL Server, it will probably be faster if you select less fields, but you should still do the speed tests. If the speed difference is not critical, I would often prefer whatever is simpler to code.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform