USE yourTable COPY STRUCTURE TO yourTableStructure extende SELECT 0 USE yourTableStructure LOCAL lcSQLCreateTbl lcSQLCreateTbl = "create table " + ALLTRIM(yourTableStructure.Table_name) + " (" SCAN lcSQLCreateTbl = lcSQLCreateTbl + ALLTRIM(yourTableStructure.field_name) + " " + yourTableStructure.Field_Type + ; [(] + ALLTRIM(STR(yourTableStructure.Field_Len)) + ; IIF(yourTableStructure.Field_Type = 'N', [,] + ALLTRIM(STR(yourTableStructure.Field_dec)),"") + [),] ENDSCAN lcSQLCreateTbl = LEFT(lcSQLCreateTbl,LEN(lcSQLCreateTbl) - 1) + ")" ? lcSQLCreateTbl CLOSE ALL
DO WHILE .T. ME.Work() ENDDO