tm22


Let me start by saying I've never used FoxPro. A client is looking at converting a FoxPro db to SQL Server (or Oracle) and I need to do a cost analysis for it. Since I'm not familiar with FoxPro, I have no clue what it would take to convert. The client application has an interface to update the data. Is it possible to keep the same interface but change the backend db to SQL Server Also, what is the best way to convert the FoxPro data to SQL Server Looks like there are 161 .dbf files.

Any info to get started would be great!


Re: new to FoxPro...in search of answers

dni


Depending of what versions of foxpro, sql or oracle, how big are dbf files...Anyway foxpro is a very good interface to SQL and you may keep it. In my opinion the best combination is vfp +SQL.






Re: new to FoxPro...in search of answers

tm22

Thanks for the quick answer...here's what will be used, VFP 8.0, SQL Server 2005. I currently don't have VFP installed, so I created an ODBC connection and imported the tables to Access to see exactly what kind of data I'm dealing with. Several of the tables wouldn't import because 'The current record is too large' or the table has too many indexes. Some of the tables have 100,000+ rows.





Re: new to FoxPro...in search of answers

Naomi Nosonovsky

You may want to check this http://support.microsoft.com/kb/129847

In VFP9 SP2 (which is just went out) the Upsize Wizard is greatly improved.





Re: new to FoxPro...in search of answers

CetinBasoz

"The client application has an interface to update the data. Is it possible to keep the same interface but change the backend db to SQL Server "

That part is hard to tell. Depends solely on how application is doing that. Probably not.

Best way to convert Foxpro data to SQL server, IMHO is doing that by hand (no wizards in between). Do not use ODBC driver but OLEDB driver. You'd need to massage structures because not all tables are directly convertible to SQL server (VFP's data structure might be in excess of maximum size for a row in SQL - in VFP it's 65000 which wouldn't be supported in SQL server).

You may start by creating a linked server and checking the tables (using Access in between is a bad idea IMHO).





Re: new to FoxPro...in search of answers

tm22

Thanks everyone, this is good info! Basically what I'm hearing is it's going to take some work to migrate to SQL Server. I know nothing about the inner workings on the client application. I think it's a 3rd party application. Access will not be used here . I've had plenty of bad experiences with Access. I used it to get started so I could see the data since I don't have VFP installed.

Does FoxPro have Primary and Foreign keys




Re: new to FoxPro...in search of answers

Naomi Nosonovsky

Yes, correctly designed tables will have primary and foreign keys.





Re: new to FoxPro...in search of answers

CetinBasoz

You don't need VFP to be installed to see the data. For seeing data on a windows computer, all you need is notepad + VFPOLEDB publicly available from MSDN vfoxpro site (Access in fact add complexity to the process). SQL server's linked server or OpenRowSet(), OpenDataSource() (latter two both need advanced options and ad hoc queries be enabled) are simply fantastic ways to not only see but get the data for bulk loading. Here is a sample:

EXEC master.dbo.sp_addlinkedserver

@server = N'MYVFPSERVER',

@srvproduct=N'My VFP Source',

@provider=N'VFPOLEDB',

@datasrc=N'C:\Program Files\Microsoft Visual FoxPro 9\Samples\Data'

GO

select * from myvfpserver...customer

select * from

OpenQuery(myvfpserver, 'select cust_id, company from customer')

OpenQuery() lets you to do provider specific (VFP here) queries. For a discussion on it check recent threads.

Foxpro have primary and foreign keys but they are not mandatory. Developer might have chose to control all integrity through application code instead. Such data is not considered bad.

You didn't say anything about the language(s) you use but I sense it may be .Net. If so, then you can also use GetSchema() of the OleDbConnection class to query various schema items. And also could use SqlBulkCopy class for uploading data.