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

Click here to load this message in the networking platform