Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UPDATE SQL Records on a Regular Basis
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01485760
Message ID:
01487453
Vues:
35
>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform