Receive file from ftp to SQL Server 2008 - sql-server-2008

How do I set up a scheduled job in SQL Server 2008 that connects to a ftp server and transfers a file either to a local drive or even better into a table.
I think I can use SSIS (at least that I read) but can't find a tutorial or like.
If I can just get the file to my local drive then I good but of course the even better solution is a file transfer directly into a table :)

Definetely possible with SSIS.
Use Business Intelligence Studio to design the SSIS package, then you can schedule this package as SQL Agent job.
SSIS can't transfer it directly to the table, but it can download it to temporary file (use FTP task), then load it to table (depends on file format, most likely you'll need to use Data Flow task), and delete file (File System task).

Related

Difference Between File System Task & FTP Task in SSIS

I want to know the exact difference between FTP Task and File System Task i gone through some tutorials but i didn't get any major differences
Can anyone help me out with this
They give the same functionality but use complete different mechanics:
File System Task is used to handle local or network (accessible, mapped drives) files. You can also change files properties to hide a file or make it read-only.
FTP Task uses the File Transfer Protocol to interact with an FTP server to move, create or delete files. This protocol involves a lot of communication procedures and handling to do these operations.
For an FTP communication you need a client and a server (that is a software running all the time listening to communications on one end), while in the File System Task the SSIS just interacts to the OS file system directly.

How do I search for new files in a Box.com Folder in SSIS to detect a new file and process the data in this file?

I've developed a SSIS ETL job/workflow to scan for new files in a folder and load the data from the new file into a SQL Server table. This job basically implements searches for a file with a predefined file name pattern in a predefined folder location. I followed all the steps mentioned here. However, the tricky part is that my company uses Box.com for file storage and the particular folder where the SSIS job has to search for new files is on Box.com. When I use my local Box-Sync Path and run the job on my local machine, I am able to execute the entire package successfully and load the new data into the required table. However, when I deploy this job in the SSIS Catalog and try to run it from the Server, the job fails as the SQL Server is unable to resolve the local Box-Sync Path that's specific to my machine.
Could anyone suggest which path I should be using to get rid of this error and schedule the job successfully on the Server.
TIA.
You will need to create a Box-Sync path on a server that your SSIS agent has access to and use either a UNC path to that Sync folder, or a path that is local to your SSIS Server.

SSIS FTP Task - File size changes

I would like to transfer a .txt file from a local machine (Windows 7 64-bit) to a Linux server.
The connection uses a passive mode and the task is set up with istransferascii = false
No matter, if I use variables or not for path destination, I face the same issue.
The task runs correctly and I receive the file into the remotepath but when I open the file, it is incomplete.
How to solve this problem and check if the file is complete?
I think the native SSIS FTP Task is not very useful.
I've used WinSCP successfully at a few sites. It seems quite reliable and has more functionality (e.g. SFTP, resuming) and much better doco and support. You can integrate it into SSIS using the Execute Process Task.
My favourite feature is that you can string a series of commands onto the command line - no need to mess with script files.

SSIS: How to I specify the server for the file connection manager (specifying existing directory)?

I'm fairly new to SSIS and am having trouble figuring out something that seems like it should be straight forward:
On server A, I have 10 files in "C:\SourceFiles\Patients" (these files are PDFs). I know the names of these 10 files and they won't change. Also, there is a server B which is the DB server and is where the SSIS package will be located. My goal is to loop through a DB table containing patients, add some patient data to the 10 source files (renaming the file) and then save this new file to server A.
I have most of this running already. Currently, all of this is happening in a script task using ADO.NET for the DB access (I'm already accessing the DB table on server B) and I'm accessing the source files on my local C drive.
I am having trouble figuring out how to specify server A in the Package Configuration for the source files. I have a file connection which specifies an existing folder (C:\SourceFiles\Patients), but it only specifies the location of the folder NOT the server. How to I specify server A for this file connection? Or, how do I use this file connection with a server A connection? I'm having real difficulty grasping this for some reason!!
The technologies I'm using are:
Visual Studio 2008,
C# in the SSIS script task,
ADO.NET in the SSIS script task and
SQL Server Management Studio 2008 (SSIS package will be imported here).
Thanks for pointing me in the right direction!
I see some issues with what you are trying to do.
PDF is an image format (an image of a document) and as such is not easily manipulated by SSIS. Generally if you are acting on a file from within SSIS, it would be a flat file of some sort, like a CSV or some other text format.
Using a script task to do all of your work within SSIS is failing to use the power of SSIS properly. If all you have in your SSIS project is a script task, you should just be using C# or VB.net directly and not involving SSIS in your project at all.
That all being said, you should access your files on server A using UNC (Universal Naming Convention) paths. You will need to pay close attention to your permissions within SSIS to make this work. When an SSIS job runs, it runs under a specific user, usually the SQL Server Agent user, and that user will need permissions to access the folder on server A remotely. When all of these permissions are set correctly, you can use something akin to \\ServerA\ShareName\Patients\ as the pointer to your directory with pdf's in it.

Pull files from FTP using SSIS package and save to folder?

I have FTP location having 2-3 folders from there i need to pull some files on daily bases using SSIS package please help.
for example:
FTP Detail
Server: ftp.abc.com:21
User: user1
Pwd: pass1
then there is a folder called Mydata and file named price(Date)
now i what to pull that file on my local machine C:\
how can I do this using SSIS?
I'd start with adding an FTP Connection Manager to your package. You will most likely want to create two variables in your package, User and Password and configure the FTP connection manager's expressions tab to use them. Reason being, you may run into issues with running the package via SQL Agent and you will need to supply those values via external configuration. Example 1 of said issue but it's a common problem
Click test and verify the connection manager is working fine.
Next step is to drop an FTP task on your control flow and see if you can master pulling 1 file down. That operation will be "Receive files"
While looking for a good image, I stumbled across this article and that should more than cover everything you will need to know about Using the FTP Task in SSIS 2008