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:
01487449
Vues:
48
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.

Thank you.

>On SQL Server side I would rather use SSIS package
>
>>
>>I have, in my VFP Desktop application, a utility that allows the user to specify criteria for data she wishes to retrieve from eight Foxpro 2.6 free tables that will be uploaded to a website for updating a SQL server database available for viewing by her clients.
>>
>>My utility creates TXT Files, one for each table of the requested data. The fields are delimited with " | " (that's the pipe character), and the text is wrapped in underscores. Using these delimiters is based on the type of data I'm dealing with and the fact that I was preparing this data for importing through the BULK INSERT command. Once the files are created, my utility automatically uploads the files via FTP to a designated folder on the site. That's as far as I've gotten.
>>
>>My intention is to write a stored procedure to automatically BULK INSERT the data into my "STAGING TABLES" anytime there are proper TXT files present in the designated location. Then another stored procedure or group of procedures will "massage the data" in preparation for the INSERT INTO command to transfer the data into properly normalized tables in the same database. Initially, each customer's import will be larger, (could average between 200 and 18000 records, not on all tables, but on some. After a client's initial import, updating will be minimal.
>>
>>This website will be updated on a daily basis with new and modified records. My questions are, is BULK INSERT the way I want to go for getting the data into my staging tables? Is there something different? Do I need to export from VFP in some other format?
>>
>>What type of script or "task scheduler" do I use to automate the process and alert SQL Server to the presence of TXT files to be imported. Remember this database will be located on my host provider's SQL Server instance.
>>
>>Thank you
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform