Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert data type of identity column
Message
From
13/08/2017 06:49:01
 
 
To
11/08/2017 20:26:00
General information
Forum:
Microsoft SQL Server
Category:
Troubleshooting
Miscellaneous
Thread ID:
01653255
Message ID:
01653262
Views:
55
>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...
Previous
Reply
Map
View

Click here to load this message in the networking platform