سؤال

Please help, I have large database in DBF where have 34 column and more than 50k record. In this case, I need 10 column only from 34 column. Logically, if I delete not necessary column will reduce data load. So I will copy structure and data from source file with specific column, but I do not know how to do it in visual foxpro.

Will you help me for this case ?

Before and after, thanks for your attention to read my problem.

Regards,

Pathic

هل كانت مفيدة؟

المحلول

Use the following syntax:

SELECT col1,col2,col3,col4,col5,col6,col7,col8,col9,col10 FROM table1 INTO TABLE table2

نصائح أخرى

If you only want to REMOVE the column PERMANENTLY, first, for grins, make a backup copy of the file. Then, make sure you are out of any program using that table and start VFP. In the command window, enter

USE C:\SomePath\YourTable EXCLUSIVE   {enter}

*/ Now, get the one column you want copied out... you can just add as many
*/ Columns, such as any primary key reference you may also want to include to.
COPY TheOneColumnYouWant to C:\SomePath\NewTableForThisColumnOnly  {enter}

*/ Now, to remove the column from the original table, now that is has been moved
*/ to the "other" table.
MODIFY STRUCTURE {enter}

This brings up a modify table structure where you can alter / delete ANY column. Scroll down the list to the column you want to delete, and at the bottom, click the DELETE button, then click the OK button to confirm structure changes. It will then come back with a confirmation prompt to "Make structure changes permanent?" and select Yes. Column now gone.

An alternative to deleting columns in VFP, you can use Alter Table via...

ALTER table C:\SomePath\YourTable DROP COLUMN TheOneColumnYouWant
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top