Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
News scoops from EssentialFox
Message
From
10/05/2002 09:29:30
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Conferences & events
Miscellaneous
Thread ID:
00649984
Message ID:
00655023
Views:
30
Hi George,

>The main reaction of folks who already have routines to handle the generation of PKs seems to be, "Well, I already have something like that and I see no reason to change to using an auto-increment column."

>I think that the folks that have expressed might want to have some second thoughts. Let's assume that this is the case, and, after the release of Toledo, developers are porting 7.0 applications to it. Let's, however, consider another possibility: That the application may in the near future need to be up-sized to SQL Server 7.0 or 2000.

>Both of those support identity columns. Identity columns are essentially the same thing as an auto-increment. Further, I think it's a reasonable guess to make that the Upsizing Wizard will be modified so that auto-increment columns map to SQL Server indentity columns.

>Wouldn't make a good deal of sense to dump the PK generation routines in favor of an auto-increment? If one did, not only would there be less code to currently maintain, but also the upsizing process would more seamless and less modifications required, especially if the developer had the good sense design against the Fox tables as if they were SQL Server tables.

Beeing some who always thinks about statements to make, I've already thought about this issue. Here is my take.

Upsizing is never an easy task. Upsizing the autogenerating key feature from VFP 7 to SQL-server is not fully possible. In VFP 8 you can add a new record in a table and having the new PK available inmediately. When using SQL-Server, you must do this either via local views or SPT. The new PK is only available whenever you've saved the record and requested the same row again from the server. The usizing process would create a difference between handling local en remote data.

In VFP you can have your custom autokeygeneration routine attached to a view as PK or as any other numbering field. This seems not to be possible with the new VFP 8 incrementing key feature. If you really look at these issue carefully you'll see that those two techniques are incompatible at the detail level.

As for upsizing, One that always works is having your own key generation routine: Don't fix it, if it aint broke.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform