Home > Archive > FoxPro Help and Support > October 2005 > Differences in Table Indexes between FoxPro & SQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Differences in Table Indexes between FoxPro & SQL
Mike

2005-09-29, 8:25 pm

On a VFP table you could create an index that consisted of an expression.
For example, I have an index that looks like
this... DTOS(DateFieldName)+
ALLTRIM(SocialSecuri
tyNumFieldName)

In SQL Server however, indexes can only exist essentially on a column name.
In SQL Server it's not possible to use an expression as an index.

So my question is, when you need to upgrade a VFP table containing
expression indexes to SQL Server, how do you accomodate the expression
indexes in SQL Server? I'm sure I could simply use a SQL table column that
contains a formula to essentially calculate the expression for each row, but
this seems too taxing.
Olaf Doschke

2005-10-01, 8:24 pm

In SQL Server you can have a compound index on the two fields
DateFieldName and SocialSecurityNumFie
ldName.
So there is no need to build an expression resulting in a
string type or whatever.

And if you search with a where clause for

WHERE DateFieldName=<somedate>
AND SocialSecurityNumFie
ldName = < somesocialsecuritynu
mber>

SQL Server would use that compound index.

By the way some pages I ound about indexes on ms sql server
(a little off topic regarding your question, but may lighten you up
on the whole topic):
http://www.windowsitlibrary.com/Content/77/17/toc.html
http://www.windowsitpro.com/SQLServ.../5665/5665.html
http://developer.com/db/article.php/3446891

Bye, Olaf.


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com