>Hi all:
>
>We are in process of moving data from MySql into Sql Server. Somebody else is actually doing the moving so I can report only on the results.
>
>The MySql tables have an AUTOINC field. When this gets moved into SQL Server the data type is BIGINT.
>
>We connect VFP to the server with.
>SQLSTRCONNECT('Driver={SQL Server Native Client 10.0};Server=someserver;Database=mydatabase;Uid=myuser;Pwd=mypwd;app=myapp')
>
>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.
>
>Any suggestions?
>
>Thanks to all .............. Rich
Thanks Greg and Tom for your replies. Maybe I wasn't clear enough as to what I am looking for.
We have a substantial number of MySql tables that need to be ported into SQL Server. The MySql Workbench utility we used automatically creates AutoInc fields as UnSigned Integers.
We used a SQL Server Import/Export tool copy these tables. This utility converted the Unsigned Integer into BigInt.
When SQLEXEC() is used to retrieve these BigInt fields from SQL Server, they get converted into Char(20). I know why this happens. I need a way around it.
In MYSQL we add OPTION = 16384 (Treat BIGINT columns as INT columns) to the SQLSTRINGCONNECT() command so this has not been a problem for us.
Is there an equivalent option in any the SQL Server Native Client 10.0 driver? I haven't been able to find one - but that doesn't necessarily mean it doesn't exist.
We are looking into ways to make the conversion happen during the Export/Import routine but, so far, everything we've seen looks as if it needs to be applied to each table individually.
If we find a way to make the conversion during the Export/Import process, we'll use it.
Failing that, is there an ALTER command which can change a BIGINT field to an INT field? My attempts to do so ran into errors but, again, that doesn't necessarily mean it can't be done.
Thanks again ................ Rich