Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Package gets all deleted records
Message
From
27/02/2008 05:21:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/02/2008 02:32:56
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Miscellaneous
Thread ID:
01296738
Message ID:
01296765
Views:
10
>I just found out that the package has taken all VFP deleted records on the process. How can I make sure that the deleted records are not imported into SQL Server? Or, should I have pack all my tables before doing the import?

Use a linked server based on ADO. Then all is easier using OpenQuery (and it automatically drops deleted ones - in fact with this approach you have problems if you also want the deleted records).
EXEC sp_addlinkedserver 
    @server = N'VFP_SERVER',  -- Your linked server name here 
    @srvproduct=N'Visual FoxPro 9',  -- can be anything 
    @provider=N'VFPOLEDB', 
    @datasrc=N'"C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\Samples\data\testdata.dbc"'


insert mySQLTable (orderId, orderDate,shippedTo)
Select * From openquery(VFP_SERVER,
'Select
  order_ID,
  Cast(Evl(order_date,Null) As DateTime) As order_Date,
  TRIM(to_Name)
  from customer')
Linked server has 2 primary advantages in your case:
1) It automatically drops deleted
2) OpenQuery allows you execute VFP syntax for VFP and SQL syntax for SQL side.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform