SQL to DBF
Posted: Fri Mar 12, 2010 3:33 pm
...::: SPANISH :::...
Bueno...
Despues de mucho trabajo he desarrollado una aplicación que se las dejo aquí, la cual importa datos de una base MS-SQL a una DBF (por medio de una sentencia TRANSQ-SQL ejecutada a gusto por el usuario) y muestra el resultado en un GRID.
Si necesitan trabajar la DBF al salir de la aplicación los resultados del GRID quedan en una DBF denominada _DATADIC.
Lo he probado con 957258 registros y funciona muy rápido, el acceso a la base MS-SQL lo hago a traves de "SQL Native Client".
Los resultados se pueden exportar a un EXCEL ( utilidad que he tomado de SUDIP con pequeñas modificaciones desde "viewtopic.php?f=15&t=284" ).
Los tipos de datos de MS-SQL son respetados al migrar a DBF, con exepción del tipo de dato BIGINT, que no sé por qué motivo la clase TODBC() toma este dato como CARACTER en vez de NUMERICO.
Los tipos de datos que están soportados por ahora son:
INT
BIGINT
DECIMAL
VARCHAR
DATETIME
NVARCHAR
CHAR
BIT
NUMERIC
Un pequeño problema se presenta cuando el nombre del campo de la tabla MS-SQL supera los 15 permitidos en xBASE, este lo trunca.
Bueno espero que lo disfruten.
...::: ENGLISH :::...
Well ...
After much work I have developed an application that I leave here, which imports data from a database MS-SQL to DBF (by a TRANSQ-SQL statement executed at ease by the user) and displays the result in a GRID .
If you need to work the DBF to exit the application of GRID results are in a DBF called _DATADIC.
I have tried it with 957,258 records and works very quickly, the access to the database MS-SQL I do through "SQL Native Client".
Results can be exported to an EXCEL (utility that I have taken of Sudip with slight modifications from "viewtopic.php?f=15&t=284").
The data types of MS-SQL are respected when migrating to DBF, with Exception of the data type BIGINT, I do not know why the class TODBC () takes this as a character instead of NUMERIC.
The data types that are supported for now are:
INT
BIGINT
DECIMAL
VARCHAR
DATETIME
NVARCHAR
CHAR
BIT
NUMERIC
A small problem arises when the field name of the MS-SQL table exceeds 15 xBASE permitted, this is truncated.
Well I hope you enjoy.
Bueno...
Despues de mucho trabajo he desarrollado una aplicación que se las dejo aquí, la cual importa datos de una base MS-SQL a una DBF (por medio de una sentencia TRANSQ-SQL ejecutada a gusto por el usuario) y muestra el resultado en un GRID.
Si necesitan trabajar la DBF al salir de la aplicación los resultados del GRID quedan en una DBF denominada _DATADIC.
Lo he probado con 957258 registros y funciona muy rápido, el acceso a la base MS-SQL lo hago a traves de "SQL Native Client".
Los resultados se pueden exportar a un EXCEL ( utilidad que he tomado de SUDIP con pequeñas modificaciones desde "viewtopic.php?f=15&t=284" ).
Los tipos de datos de MS-SQL son respetados al migrar a DBF, con exepción del tipo de dato BIGINT, que no sé por qué motivo la clase TODBC() toma este dato como CARACTER en vez de NUMERICO.
Los tipos de datos que están soportados por ahora son:
INT
BIGINT
DECIMAL
VARCHAR
DATETIME
NVARCHAR
CHAR
BIT
NUMERIC
Un pequeño problema se presenta cuando el nombre del campo de la tabla MS-SQL supera los 15 permitidos en xBASE, este lo trunca.
Bueno espero que lo disfruten.
...::: ENGLISH :::...
Well ...
After much work I have developed an application that I leave here, which imports data from a database MS-SQL to DBF (by a TRANSQ-SQL statement executed at ease by the user) and displays the result in a GRID .
If you need to work the DBF to exit the application of GRID results are in a DBF called _DATADIC.
I have tried it with 957,258 records and works very quickly, the access to the database MS-SQL I do through "SQL Native Client".
Results can be exported to an EXCEL (utility that I have taken of Sudip with slight modifications from "viewtopic.php?f=15&t=284").
The data types of MS-SQL are respected when migrating to DBF, with Exception of the data type BIGINT, I do not know why the class TODBC () takes this as a character instead of NUMERIC.
The data types that are supported for now are:
INT
BIGINT
DECIMAL
VARCHAR
DATETIME
NVARCHAR
CHAR
BIT
NUMERIC
A small problem arises when the field name of the MS-SQL table exceeds 15 xBASE permitted, this is truncated.
Well I hope you enjoy.