How to get the SQL script of Import task - sql-server-express

I am using the Import feature in SQL Express 2008
When I get to the end of the wizard, I can run it, but how do I found out the SQL code so I can run this script via automation tools (such as a bat file)?

The Import and Export Wizard generates a SSIS package (dtsx) for you. You can use the command line utility dtexec.exe or dtexecui.exe to automate the import process in a batch file.
You can also inspect the SSIS package inside SQL Server Data Tools.

You won't get SQL scirpt, because MSSQL "Import and Export Data" tools doesn't offer that. But you can do your self by using "BULK INSERT" mssql command. Behind the scene MSSQL "Import and Export Data" tools do that.
Here is reference using BULK INSERT: https://msdn.microsoft.com/en-us/library/ms188365.aspx
Tutorial using BULK INSERT: http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/

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 run .sql file in Oracle SQL developer tool to import database?

I have exported database from Oracle SQL developer tool into .sql file. Now I want to run this file which is of size 500+ MB.
I read about running scripts here, but I didn't understand the way. Is there any command or query by which we can run this sql script by providing path?
You could execute the .sql file as a script in the SQL Developer worksheet. Either use the Run Script icon, or simply press F5.
For example,
#path\script.sql;
Remember, you need to put # as shown above.
But, if you have exported the database using database export utility of SQL Developer, then you should use the Import utility. Follow the steps mentioned here Importing and Exporting using the Oracle SQL Developer 3.0
You need to Open the SQL Developer first and then click on File option and browse to the location where your .sql is placed. Once you are at the location where file is placed double click on it, this will get the file open in SQL Developer. Now select all of the content of file (CTRL + A) and press F9 key. Just make sure there is a commit statement at the end of the .sql script so that the changes are persisted in the database
You can use Load function
Load TableName fullfilepath;

Export database from SQL Server Management Studio

I've managed to 'Restore' my database using the SQL Server Management Studio.
I now need to export that so I can import it into my websites empty database.
I've tried Tasks/Generate Scripts but I can't import the file it generates into my database on my site.
I get the following error message:
Could not find stored procedure 'xxx'
I've also tried to Export Data but I don't appear to get a result at the end of the process. Possibly because I'm using the free version of the software?
Are there any other ways to export this data into a .sql file so I can import it?
I'm just moving a site from one server to another - it shouldn't be this difficult!
Any help would be really appreciated!
Try the Microsoft SQL Server Database Publishing Wizard. Available at:
http://www.microsoft.com/en-us/download/details.aspx?id=5498
Use the generated .SQL file with these steps:
http://www.123-reg.co.uk/support/answers/Databases/Windows-MSSQL/how-do-i-import-export-a-mssql-database-793/
I don't know if you've managed to resolve this but I have found that the SQL file saved from SSMS is in Unicode format and the 123-Reg website is expecting plain text. This is what's causing the "Could not find stored procedure..." error message.
Instead of saving the file, copy and paste the text from SSMS into Notepad, then save that. The file should then upload correctly into the remote database.

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

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.

sql server 2008: importing data from excel 2003 file

i have a very simple excel file that i need to import into a table in sql server 2008.
one of the fields is a bit complex and i dont think it can be saved effectively to a csv, since it sometimes has comas and single quotes in it. it screwed up the formatting when i save to a csv. so i would like to try to import directly from the xls file.
does anyone know how to import from xls to sql server ?
For Express, run C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTSWizard.exe
try using the sql server management studio
right click in your database -> Tasks -> Import Data..
check this link for more info
How to: Run the SQL Server Import and Export Wizard
SQL Server has an import wizard that works with .xls files.
The import wizard generates an SSIS package for you. If you want more control, you can create the SSIS package yourself in Visual Studio.
SQL Server Integration Services for the win. Check this out!