Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimize SQL Query
Message
 
 
To
31/07/2009 10:12:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01415652
Message ID:
01415653
Views:
66
>I know how to make SQL statements querying against foxpro data fast using the indexes but how does it work for SQL Server. There is table that holds holidays with and index on company Char(10), fiscal Char(4), holiday datetime.
>
>How do I write a SQL Query that will use this index? I don't think I can pass up company+fiscal+holiday in the SQL Query because of the mismatch in datatypes. Also can I use partial matches to get optimization as well. For example if I just want to match the company and fiscal in foxpro I could still query using the entire index and just put the partial value to match and it would use the index to retive the data.

In SQL Server (newer version) look up at Covering indexes in Help.

What indexes do you have so far there? What is the statement you have been trying?

In SQL Server you need to compare each field individually. Also, you would need to test your query in SSMS and check execution plans.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform