A place to wax about the VFP upsizing wizard

The wizard is very good with the following: 1. Structures 2. Indexes (CDXs only) 3. Primary keys I think it converts Default values as well but I don't remember. Will it migrate Stored Procedures? AFAIK, SPs will not upgrade. There is really no way they can. SPs are written using SQL and VFP code. In order for the upsizing wizard to convert it, it would have to change the VFP code to PL/SQL (Oracle) code. It can't do this. I ran into the same issue when I upsized a VFP database to SQL Server. It could not convert the VFP code to T-SQL (SQL Server) syntax. You will have to do this manually. Larry Miller

Use the vfp wiz to create scripts. Then write some prg code to modify the scripts to your liking. Then run the scripts.

Other than the problem with dates (see below) I have had reasonably good luck with it. When migrating data from a FP app to People Soft, it was handy to push all of the data onto the Oracle server so that the consultants could get at it in an environment they were familiar with. It took about an hour to push 800K of data. -- CFK

Here is something in the upsizing wizard that may bite you: a VFP date field that does not support nulls but has an empty date will error. It will create the field in the table as had an unused date field so every record failed to be inserted.

date not null, and then convert the blank date to a null and try and insert it. I

Did you try to run it with SET NULL OFF -- Bob Archer There are no nulls involved. No nulls in the VFP table or in the SQL table, so SET NULL would have no effect. -- ?CFK An idea to try here: find out what dummy date the SQL database uses to represent nulls, and fill your null dates with that value before you upsize. How about NULL ? ;) ?CFK I ended up writing my own -- here is a copy of it. You are welcome to use it, but don't be surprised if it does not do exactly what you need it to. You will learn from it. http://dev.personnelware.com/carl/pub/fo.zip Take a look at the prg. That is where the good stuff is. For the Wiki, I would like a more educational version of it. If someone would like to work with me I will help create such a thing. -- Carl Karsten

I'm using Data Transformation Services in SQLServer 2000 and SQLServer 7. DTS is great for migrating data from any data source to a target in SQL. It took me about an hour or so to figure it out (had a few pointers from a colleague, too.) Well worth the time to learn IMHO. -- Randy Jean

This isn't really an upsizing wiz, but it is something similare. If someone can figure out what it is and give it a home, it would feel much better. -- ?CFK


prg SET ALTERNATE on ? "Modify database MM nowait" ? "CREATE CONNECTION " + lcConName + " connstring '" + lcSqlConStr + "'" ? SCAN lcTableName = TRIM( table_name ) SQLCOLUMNS( lhX. "columns" ) lcPK = TRIM( columns. lcTableName. " ) + TRIM( column_name ) ENDSCAN .lcSqlConStr = CSBASE+"uid=WnlUser. "TABLE". "Tables" ) SET ALTERNATE to \temp\test.pwd=" lcConName = "WNL" lhx = SqlSTRINGCONNECT( lcSqlConStr ) ? SQLTABLES( lhx. "NATIVE". "". lcFields + ".column_name ) lcFields = "" SCAN lcFields = IIF( EMPTY( lcFields ).

tcFields. tcWhere ) ? "create view " + tcViewName + " remote connection " + tcConName + " share as .t. lcTableName. lcConName. "_" ) xOneView( "v_" + lcTableName + "_One". lcPK. 'view'. "" ) lcWhere = " where " + lcPK + " = ?lk" + STREXTRACT( lcPK. lcPK. lcWhere ) ? ENDSCAN ? "do moredbc" SET ALTERNATE to ? SQLDISCONNECT(lhX) RETURN FUNCTION xOneView( tcViewName. tcTableName. tcConName. lcTableName." ? " select " + tcFields + " from " + tcTableName + tcWhere ? "dbsetprop( '" + tcViewName + "'.xOneView( "v_" + lcTableName. )" . lcFields. 'SendUpdates'. . tcPK. lcFields. lcConName.

at least it will only send back the updates a record at a time. . renames or deletes? MyTable. The procedure is the following: I upsize all tables. but slowly. views. pffft! I it will 'work'.dbf.? "dbsetprop( '" + tcViewName + "'. cFirst+cLast as cName from mytable where cState="CA" Here is what will happen: the remote view named myview will be 'opened' that causes "select * from mytable" to be sent to the server the results are stored in a tmp file on the local machine. 'field'. Let's look at the simplest query: --select * from mytable --If the table "mytable" is on sql server 7 and I have an ODBC connection. 'KeyField'. . The view will grab ALL of the data and present it just like MyTable. Now my tables are in sql server and my interface-application remained in my original visual fox pro database.t. )" * ? "dbsetprop( '" + tcViewName + ".dbf looked like.to make this stuff work? How will I make the same tasks with this remore database-server connection as I did with a single visual foxpro application? I mean: writing data into the tables(now exist on sql server instead of directory in visual foxpro application. 1 )" ? "dbsetprop( '" + tcViewName + ". )" ? return Category Needs Refactoring : I plan to use my visual foxpro database application with SQL Server 7 database table-set from this visual fox pro database. relationships etc. Well. which means it will pull the whole table onto the workstation each time you access it." + tcPK + "'. making reports etc. 'Updatable'. MyTable Now any time you "use" MyTable. how this command should be changed to work properly as it worked before? First. . 'WhereType'. it will actually use the view instead of the old dbf.). It will be easier to look at your "simplest query" if ts is a bit more complex: (help keep it apart from the view's query) select cID. asking queries. the therory is: Your app will just run as it did before." + tcPK + "'. The view will be an unparamertized view. Why? because each of your tables have been converted into a view of the table on the sql server. 'view'. lets look at what the upsizing wizard did to MyTable: It built a table on the server called then it coppied all the data to it. it moves. with the help of ODBC connection. Then it created a remote view like this: create sql view MyTable remote connection mm share as select * from Finally. from my visual fox pro database into sql server7. 'field'.t. but now your dbc will use the SQL server to read/write data. MyTable with the same structure. Now how to continue? What commands should I give and where .

. Advice for people whow need to upsize an app: Try the wizard and run the app. next step 4: next step 5: new. wizards. "VIEW" ) lcView = laViews[lnView] lcSql = DBGetProp( lcView. "hello world") create a DSN that points at SQL server: mydsn Tools. next step 8: check "create remote views on tables".. next step 3: mytable.hit ok Before App: Use mytable After Use mytable Dbf: mytable_local Dbc Dbf: mytable View: mytable mytable Sql Server (empty) More code that needs a home. * ViewUpper. Whatever happens.. but performance may be bad in some places. lcSql EndFor . It may work. the results of that query are stored in a second table. finish (wizard wizzes.) dialog: "Upsize Complte" . It may work well.prg Open Database P:\html\temp\jz\newusa. next step 9: set "upsize and save generated SQL". cFid1 c(11) ) INSERT INTO mytable VALUES (1. "SQL" ) ? lcView. "VIEW". upsizing step 1: mydbc. It may work.then the select cid. cFirst+cLast as cName where cState="CA" is executed against the temp table. -. mydata. it shouldn't take more than a day and you will have a better idea of what to do next.dbc For lnView = 1 to ADBObjects( laViews. but performance may be bad in all places. next step 2: mydsn.CFK Sample run: CREATE DATABASE mydbc CREATE TABLE mytable ( PK_mytable i PRIMARY key. It may not work at all.