Receive Excel Files from FTP Task changing file names everytime - sql-server-2008

Im loading excel files from ftp server to SQL Server where ftp server will contain only one file.
There is change of having the file with different name on monthly basis and old file is deleted. At that time if we run the package the package will fails, because ftp server contains new file with new name.
So, how to capture the new file.
Can anybody help me?

you need to use MASK to set the file name for example *.xlsx. Go to FTP Task Editor, set RemotePath to /your ftp path/*.xlsx.

Related

Automatically created Excel file

I have an SSIS package for importing excel files into the database.
In my source folder, I got an automatically created excel file, and I did not create that file. Even after I delete it, the file will be created again, and it shows that my user account is the owner of the file.
I do not know if any process creates the file.

How to convert bak file into sql file (sql bak file to mysql supported) and the execute that file to restore automatically

i want to convert a bak file of sql server into .sql/.csv/.xml file for mysql database.
And then i need a script that will automatically pick the file from server drive(suppose file is in D drive in mycomputer and script will automatically pick file from D drive) and execute sql/csv file to restore into my sql database(online) .
Actually i have two system, 1- is on VB that runs on local host and generates a bakup file daily
in the system and now i am going to create a new web application for same system that runs on VB.
i want that in my web application i write a script that will pick and backup file and ist convert into mysql supoported format(sql/csv/xml)(if necessary) and then execute that file for updating into mysql online database.
ANy kind of help will be highly appericiated.
many thanx in advance.
Possible by using MySql Migration Tool kit.
First install the software ,follow below steps

Use SSIS to transfer file from FTP to Server

This is probably too simplistic a question but here goes.
I have a client that will drop xls files into a folder on our FTP site. I need to check if a file exists, I need to move it from the FTP folder to a folder on the server. Once the processing is done, I need to send another (but different) xls file back to a folder on the same FTP server.
I can see that there is an FTP task and I can connect to the FTP site, but I am unsure on how to specify where to send the file and also how to only select a file at a time.
I think if I just concentrate on the first part, I can work on getting the file back as a second step.
So the end result is to check the folder on the FTP site, if a file exists move it to the server.
The SSIS FTP task wraps the basic FTP syntax you would use if you were connecting to the FTP site interactively. Here's a review of basic FTP syntax.
So here's what you should be looking for when you're editing the FTP task. 1) The task needs to log into the FTP server, 2) it needs to know that it is performing a GET operation, 3) it needs to know the path and filename of the file it is supposed to retrieve from the FTP server, and 4) it needs to know where to drop the file on the local server.
So, in the FTP Task Editor, you want to go to the General tab and create an FTP connection. Then go to the File Transfer tab, and then set the "Operation" -> "Receive files", and fill in values for the Local Path and the Remote Path. (Or you can keep those paths in SSIS variables and have the task get them from there.)
The IsTransferAscii setting is False by default. This means it will assume it is transferring a binary file. Alternatively, if you tell it to treat it like an Ascii file, it will try to fix the line endings to account for the different combinations of carriage return and line feed characters used by various operating systems. You don't want that if you want to transfer the file verbatim, but you might want it if you're going back and forth between Windows and Linux or something.
You should also learn a little interactive FTP syntax. I often use this to figure out why SSIS is having a problem transferring files. Go to the command prompt and type "ftp". You can then type "?" to see a list of commands. Or just type "ftp yourservername", log in, and use cd and ls to walk around the directory structure and see what's there.

Where to download AdventureWorks2008.msi?

I'd like to install AdventureWorks2008 (I just install SQL Server 2008 R2 Express).
Each time I download the recommended version from CodePlex, all I get is a AdventureWorks2008.mdf file. Not only I cannot attach the file from SQL Server Management Studio, but I cannot copy/paste the file directly into the the database.
I've read in several places that I need to use AdventureWorks2008.msi, but I cannot find where to download it.
I just cannot figure out how to install AdventureWorks2008
Thanks for helping
There isn't an .msi file for adventureworks, even though you'll find it mentioned in outdated documentation and books. You aren't alone in finding this confusing -- it seems the web site, files and steps Microsoft provides for installing these databases changes every time I need to install them.
You need to create the database and attach the .mdf file, which is the "data file" referred to in the instructions. (.mdf = primary data file, .ldf = log file, .ndf = secondary data file)
In order to attach the file, you need to make sure you carefully follow the steps here: http://social.technet.microsoft.com/wiki/contents/articles/3735.sql-server-samples-readme-en-us.aspx#Readme_for_Adventure_Works_Sample_Databases
Instructions for 2008R2:
To install AdventureWorks2008R2 OLTP database
Download the AdventureWorks2008R2 Data File.
From File Download, click Save and browse to a location on your local
server.
From SQL Server Management Studio, execute the following code:
Case-insensitive Database
CREATE DATABASE AdventureWorks2008R2
ON (FILENAME = '{drive}:\{file path}\AdventureWorks2008R2_Data.mdf')
FOR ATTACH_REBUILD_LOG;
As an alternative to step 3, you can attach the database using the SQL
Server Management Studio user interface. For more detailed
information, see Attach a Database (SQL Server Management Studio).
Note: You must remove the log file from the list of files to attach.
This will cause the operation to rebuild the log.
Headache saving tip from Aaron Bertrand:
You should place the mdf file in your normal data folder - SQL Server
will already have the proper permissions. You can get this path using
SELECT TOP (1) physical_name FROM master.sys.database_files;
You can directly paste that file into your database directory. For more information you can refer http://tryingmicrosoft.com/error-while-attaching-a-database-to-sql-server-2008-r2/.

How to move file using File System Task in SSIS package

I am very new to SSIS, looking at a package already created by someone else and deployed on SQL server. There is a File System Task that moves files to a network share. I need to change the path of the destination folder. The destination folder requires a domain login.
I can change the folder path in the
global variable. Do I have to
redeploy the package after making
this change? Can the change be made directly on the SQL server?
How do I change the user name and password for this network share? Where is this infomation saved? I don't see it in any of the variables.
There is a SQL Job on the server with the same name, how do I check if this Job is related to the SSIS package?
You can change the folder path in the variable. You will need to redeploy after doing this unless the variable is stored in a configuration file. If that is the case, you can just change the configuration file, and won't need to redeploy.
The user name and password will probably be stored in the Flat File connection. Look at the bottom of the package in the section labelled Connection Manager.
If there is a job of the same name, it was most likely created for the SSIS package of the same name. If you open the job for editing in SSMS, you can look at the job steps and confirm that the dtsrun command references the SSIS package.