Solved

cgi-bin file - can SQL import or link to remote file

Posted on 2011-03-14
2
380 Views
Last Modified: 2013-12-25
I want my local sql 2000 server to connect over the internet to our ISP where I host a website. We need it to link to/import a flat file in the sites cgi-bin into my SQL server. Is this possible and how do we do it?
0
Comment
Question by:ron69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 500 total points
ID: 35139097
If you have access to a SQL 2005 (or later) server, you can do this using SSIS, which has a built-in FTP task that would make getting a file from a remote FTP site pretty straightforward.

If you only have SQL 2000 (upgrade - it's unsupported!), then you can use a modified version of this walkthrough:

http://www.sqlteam.com/article/using-dts-and-ftp-to-push-files

In that example, he pushes the completed file to FTP, but you could easily modify the script to get the file instead of put it on the site - just change the "MPUT" command in the FTP script to "MGET" and it will fetch the file from the remote site and save it locally. Once that's done, you can connect to it in your package just like you'd connect to any other local flat file and import the data that way.
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 35139203
Assuming you have all the required vpn settings in place, so that the share on the website is exposed as a UNC path, you should simply be able to use something like the following:

BULK INSERT <Table_Name>
FROM '<unc path>'
WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' )

There is also the OPENROWSET statement:

http://www.databasejournal.com/features/mssql/article.php/10894_3331881_3/OpenRowSource-and-OpenRowSet-in-SQL-Server-2000.htm

Regards,

Lozzamoore
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question