Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Data
Message
From
11/01/2008 10:59:27
 
 
To
11/01/2008 07:13:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01281057
Message ID:
01281165
Views:
12
Do you mind sharing your upsizing code? 8->

>>I did get a 6 month contract to hire today. And it's at a competitor to my former scam company. My first task is to export data from the old VFP accting app to SQL Server.
>>
>>We are trying to do an Import thru SQL Server. But we are getting an error on date columns. I'm sure this has been discussed here before is there a way to fix this, or another way to transfer the data. The error is:
>>
>>Insert error......(column, dtype_dbtimestamp), status 6: data overflow. Invalid character value for cast specification
>>
>>
>>Thanks.
>
>Perry,
>If it were DTS of SQL 2000 I'd say check old threads in VFP forum (as I remember original poster was Charles Hankey) for a fix in vb code generated.
>
>With SQL server 2005 and 2008 what I do is simply run a routine on a copy of VFP database to convert date/datetime fields to accept nulls and replace empty values with nulls.
>
>Another one I use (and I actually like this one more) is to create a linked server to VFP (at least temporarily) and use that with OpenQuery() to 'convert emty dates to nulls' on the fly. It looks like:
>
>insert into mySQLTable (myField1, myField2, myField...)
>select myVFPField1, myVFPField2, ... from OpenQuery(myVFPServer, 'my query here')
>
>
>ie: (assuming what is retrieved matches mySQLTable field names and order)
>
>insert into mySQLTable
>select * from openquery(myvfpserver,
>'Select c.cust_id, c.company,
>  o.order_id,
>  cast(EVL(o.order_date,null) as date) as orderDate,
>  cast(evl(o.shipped_on,null) as date) as shipped_on,
>  e.First_Name-(" "+e.Last_Name) As Employee,
>  cast(evl(e.birth_date,null) as date) as birth_date,
>  oi.line_no, p.prod_name,
>  oi.unit_price, oi.quantity
>  FROM  ("C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\data\customer") c
>  INNER Join ("C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\data\orders") o
>  ON  c.cust_id = o.cust_id
>  INNER Join ("C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\data\Employee") e
>  ON  o.emp_id = e.emp_id
>  INNER Join ("C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\data\orditems") oi
>  ON  o.order_id = oi.order_id
>  INNER Join ("C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\data\products") p
>  ON  oi.product_id = p.product_id
>  order By p.prod_name')
>
>
>For creating whole syntax I, of course use some VFP code to write it for me, rather than typing N fields:) Then directly from VFP I can run this via SPT or use M.Studio new query window or save as .sql to run later. Writing whole 'create database', 'create table' ... 'insert ...' series I find it easy to do with VFP's textmerge capabilities. I hope you still have VFP installed to do this job. Alternatively you could use SqlBulkCopy class from a .Net code (however I found doing that from VFP as the easiest).
>
>Also they claim SP2 upsizing wizard has got much better but I don't know, haven't installed SP2 and still using my own upsizing codes.
>
>Cetin
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform