How to create an SSIS package to import flat file and schedule it to run as an SQL job? - sql

does anyone know really good step by step tutorial to create a package to import tab delimited flat file into a table using SSIS and then schedule it to run as an SQL job at specified time?
Or maybe someone can show me how to do it?

The easiest way to get started with SSIS is, using Management Studio, right click on the database you want to import into, under Tasks, select Import data. This kicks off a wizard which is quite straight forward. At the end of the wizard, you have the option to save the package to the server or to a file. If you save it to a file, you can then create a job and set the step type to be Sql Server Integration Services Package. You can then configure the parts of your package and schedule the job as normal.

Related

importing CSV from SAP R/3 to SQL database for reporting purpose

I want to import CSV files and invoices from SAP R/3 system into a SQL database. The database will be used for reporting purpose only, please tell me what will be the best possible way, which database to use and anything else that will be relevant to me in this context? and I am novice so please help....Thanks:)
If you are routinely importing CSV files then I recommend getting them comma delimited (or whatever delimiter you choose) and going the route of making an SSIS package with a corresponding SQL Agent Job that runs daily to check for the file and run it if it finds it.
Info on SSIS package creation:
http://smallbusiness.chron.com/import-csv-ssis-46849.html
If this is a one time load then I would recommend just using the import export wizard built into SQL Server.
https://msdn.microsoft.com/en-us/library/ms140052.aspx
Pretty easy to use the import export wizard too. Right click the database > tasks > import data. This will launch the wizard and will walk you through the one time import.
Adding Microsoft's official SSIS guide as well:
https://msdn.microsoft.com/en-us/library/ms169917.aspx

HOW TO EXPORT/ IMPORT DB FROM SQL SERVER

I need to export the db including all the tables from SQL Server and then to import it to another computer with SQL Server.
I tried to do:
tasks-> generate scripts
But when I tried to import this db
by attach he doesn't recognize this file.
how should i do it correctly?
we did our project on my friend computer but i want to get it for myself to...
What you tried is to generate the scripts in order to create the database structure (if you want to use these scripts you need to execute them from SQL Management Studio on your other computer). That's a good solution if you only want to create the database structure on another computer.
If you want to restore the database on another computer with all the structure and data of your database, right-click on your database from SQL Management Studio -> Tasks -> Back Up.
After creating a backup of your database you simply need to copy the generated file to another computer and proceed the restore process.
Here is a link that explains the entire process: Create a Full Database Backup
Hope this will help you.
You can use Backup\Restore technique to make exact copy of your database, But like you said, you only want your tables to be transferred so you can use 'SQL Server Import Export Wizard' for the same.
Right Click on db -> tasks -> Export data
Using above option you can store all data into a flat file also and take that flat file to destination and import the same.

Automating the Export Data Task

I have a database on one server that I need to copy to another server. I can do this manually using the Export Data task, which is fine for a one time export, but I would like to speed this up as it is going to be repeated.
The database will always contain the same set of tables, I just need to get a copy of this database with it's tables and their data from one server to another.
I'd like to create some sort of reusable tool that allows you to specify the source and target database servers and then copies this specific database from one to another. Is this possible?
The Export Data task in SQL 2005 and later uses SQL Server Integration Services (SSIS) under the hood. You can save the package you're already using and run it on a schedule or on demand. You can also edit it (once it is saved) using the Business Intelligence Development Studio (BIDS).
At the end of the Export wizard (on the "Save and Run Package" screen), you can tick the "Save SSIS Package" check-box to store the package either within SQL server or on the file system. The file system is probably simpler.
Once you have the package you can execute it from the command line using the dtexec tool, or from a SQL Agent job using an Execute SSIS task.
SSIS is too big a subject to cover in full here - there are decent tutorials within SQL server books online if you need more details - alternatively, as another SO question if you get stuck.

can a sql 2005 ssis package be scheduled?

I have a data dump that I manually initiate and I want to automate things now that they are working well. I have a system that exports data into Excel that I ultimately want to import into a SQL table.
I have a ssis package that I used for the import and saved it for re-use later. I just manually ran it and it works well. Now I would like to have it run either when invoked by a file watcher or schedule or some thing so that all I need to do is over-write the excel file and have it trigger the ssis to run its import.
Any ideas on how to make this happen?
SQL Server does its scheduling with SQL Agent, so try creating a schedule in that to do what you want.

How to run an SSIS package in SQL 2005?

Every month I get an updated list of USPS ZIP codes, which I dutifully import into my SQL Server 2005 database. It's really a simple process, and during the import process, there's a little tick-box that allows me to "Save as SSIS package". Which, of course, I did.
But this is the really crazy part... now that I've saved it - where is it? There is no documentation I can find that tells me where this supposed SSIS package can be found, so I can run it again!
When you connect to SQL Server, connect to Integration Services, not Database Engine. You should be able to find your packages within the structure that appears.
You have two targets to save too:
SQL Server (stored in MSDB)
File System (you get to choose folder etc)
What did you choose?