Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE SQL Records on a Regular Basis
Message
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01485760
Message ID:
01487455
Views:
34
>>Sergey,
>>
>>I have determined that SSIS package is not an option at this time, and my shared-hosting provider prevents BULK INSERT as an option. Now I am looking at connecting to my SQL database through ODBC and using SQL Pass-thru commands such as SQLEXEC() with INSERT commands to add the records to my staging tables on the remote server from my local tables on my workstation.
>>
>>As I stated earlier the initial upload for a set client may have numerous records, but after the initial upload, updating a client's records will be less than 500 in most cases.
>>
>>I'm able to successfully add data to my remote SQL tables with the syntax:
>>
>>
>>    lnSuccess = sqlexec(1, "insert into src.nameplat(src.custid, src.upsino) values('LA22222', '88888888')")
>>
>>
>>But is it possible to do it with the following syntax:
>>
>>    lnSuccess = sqlexec(1, "insert into src.nameplat(src.custid, src.upsino) select custid, upsino from localnameplat where custid = 'LA22222' ")
>>
>>
>>With that I get an ODBC SQL error stating that "localnameplat is an invalid object".
>>
>>I suppose the message is telling me that my local table "localcnameplat" is NOT a table on the SQL server. Ok, I get that.
>>
>>So how do I INSERT records from my local Foxrpo table into the remote SQL Server table? Am I going to have to create a local foxpro cursor and step through the records and do some kind of SCATTER....GATHER routine? Even though I will be dealing with small record counts, I don't think that would be efficient.
>>
>>Any insight? I really would like to use the ODBC and SQL Pass-thru if at all possible.
>>
>You may want to use CursorAdapter. If you will be using SQLPassThrough, there is no other method than to scan the cursor and create individual insert statements.

I'm on VFP 7.0. No CursorAdapters in VFP 7 right? Currently my application doesn't use a database container. Do you think I should go through the work of setting up a database and using remote views instead of SQL Pass-thru. Since most of the updates will be less than 500 records, will SQL Pass-thru with scanning the cursor and doing INSERTS not be efficient enough? Will I experience an enormous drop in peformance?
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform