Importing other versions of an Excel Sheet into SQL Server 2014 - sql

I was wondering whether there might be another way that will allow SQL Server 2014 to import other versions of excel and not only 2007.
Currently my SQL Server is not linked to a datawarehouse whereby I can link the tables and pull data, so therefore extracts are being pulled from the application system and those extracts are imported into SQL Server with Excel 2007. Now the issue is that Excel only allows +-65 000 lines, therefore the rest if the data is not importing into Excel.
I have tried to convert the file to a txt format but due to the different format of each field, the data gets 'scrammed' and is not pulled correctly into the columns.
SQL Server only allows for a Excel 2007 version to be imported, is there another way to import an Excel worksheet as that will allow me to pull in lines more than 65 000 or is there perhaps another way to go about it.
(the txt file does not work).

Related

UNION ALL with Excel file as data source

I have got the following Problem.
I have several Excel files containing each the data of a country in one folder.
However I want to pull that all into one Excel report.
As the content of the source files change dayly, I guess the best way to do that is to do a import via an SQL Statement using Union All.
However the problem is that MSQuery only allows me to Access one file at a time. Is there a Workaround for that problem?
Maybe create a data model and use DAX?
This sounds like a job for Power Query, a free add-in from Microsoft for Excel 2010 and Excel 2013, and built into Excel 2016 as "Get and Transform" in the Data ribbon.
You can create individual queries to the different Excel files in the different folder, then create a query that appends all previous queries into one table, which can be loaded to the Excel data model or a worksheet table for further processing.
The queries can be refreshed with a click when the data has changed.

Missing columns while importing excel data into SQL Server 2012

I am moving Excel data into SQL Server 2012 using the Import/Export wizard.
The Excel sheet has 377 columns, but when I am importing the file into SQL Server, only 255 columns are appearing in the table. Where are the rest of the columns?
Unfortunately this is a limitation of the ACE driver so not easy to overcome.
An easy solution that I see is to open up the Excel sheet in Excel, then save as CSV. Then use the Import wizard to import the CSV.
I'm not sure if you're aware of this, but the Import/Export wizard is actually using SSIS. In one of the last screens, you have the option to save the SSIS package (.dtsx).
To get the workaround with the names ranges to work, you'll first need to import the two ranges in two separate tables and then join them together to fill up the final table.
Maybe this helps as well: http://blogs.msdn.com/b/dataaccesstechnologies/archive/2011/01/22/importing-excel-2010-data-into-sql-server.aspx

Script to import ever changing Excel CSV file into SQL Server Express 2008

I have looked at this site and several other, and the closest I could come to was Dealing with a changing Excel table structure to import to a database table
But I'm actually looking for the script to identify the Column Name and Type from the CSV file, and to create the Table from that.
The actual Importing script is working well, but it only caters for fixed Headers, while I have headers varying between 160 and 170 during any given time.

Multiple excel sheets import/export to SQL Server

I have to export SQL Serverdata to Excel and edit (make a few changes) later restore it in the data in SQL Server database itself. I have tried doing this manually but can I do this task using SSIS or some other way because I have to do this several times a day.
Googled for this all that I could find was using SSIS which has ability to export/import data of 1 sheet not multiple sheets
Thanks in advance for your answers
In SSIS, in the Excel Source component, you can simply specify the sheet name. You can have multiple Excel Components, or programmatically change the sheet name inside a loop.

BCP utility to create a format file, to import Excel data to SQL Server 2008 for BULK insertion

Am trying to import Excel 2003 data into SQL table for SQL Server 2008.
Tried to add a linked server but have met with little success.
Now am trying to check if there's a way to use the BCP utility to do a BULK insert or BULK operation with OPENROWSET, using a format file to get the Excel mapping.
First of all, how can I create a format file for a table, that has differently named columns than the Excel spreadsheet colums?
Next, how to use this format file to import data from say a file at: C:\Folder1\Excel1.xsl
into table Table1 ?
Thank you.
There's some examples here that demonstrate what the data file should look like (csv) and what the format file should look like. Unless you need to do this lots I'd just hand-craft the format file, save the excel data to csv, then try using bcp or OPENROWSET.
The format file specifies the column names for the destination. The data file doesn't have column headings so you don't need to worry about the excel (source) cols being different.
If you need to do more mapping etc, then create an SSIS package. You can use the data import wizard to get you started, then save as SSIS package, then edit to your heart's content.
If it's a one-off I'd use the SQL data import size, from right-click on database in mgmt studio. If you just have a few rows to import from excel I typically open a query to Edit Top 200 rows, edit the query to match the columns I have in excel, then copy and paste the rows from excel into SQL mgmt studio. Doesn't handle errors very well, but quick.