Information générale
Forum:
Microsoft SQL Server
>The MySql tables have an AUTOINC field. When this gets moved into SQL Server the data type is BIGINT.
>
...
>The problem is that this driver brings the value down as CHAR(20) rather than as a number.
>
>Is there some paramater I can add to the connection string that would allow converting a BIGINT to a VFP Int value? I'm pretty sure there is some such option in the MySql driver but I can't find it for Sql Server.
>
>Failing that, is there some way I can convert all the BIGINT fields to INT after the data has been imported? I've found that I can manually use the table designer to make the change and our utilities for adding records will respect the identity column.
>
>But it sure would be easier to run a script to do that for me. All my attempts have run afoul of some constraint condition.
>
As Greg already pointed out, BIGINT is 8 byte. In vfp the best corresponding type would be currency. Integer only if you can guarantee that the values in the BIGINT field always fall inside the 4-byte range. No connection tricks here, I would access in normal usage via cursoradapter and probably use such a way for porting - you could probably write a small program analyzing source table schema, generating a update scirpt and run that automatically tweaks your vfp intermediate table, but safer and probably faster is to feed SQL server with the val() of the char field...
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement