Missing columns while importing excel data into SQL Server 2012 - 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

Related

Importing other versions of an Excel Sheet into SQL Server 2014

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).

How can I join Excel column and SQL View?

I have an Excel spreadsheet, with one worksheet, with one column, containing key values I want to use to lookup data in a SQL Server view.
I can import the view data just fine using ADO or ODBC, but cannot figure out how to have the "Microsoft Query" tool add both the Excel Worksheet and the SQL View in a single query, so that I can join the data. I had also hoped VLOOKUP might lookup external data, but did not find anything,
I have looked for hours and am stumped. Certainly this can be done somehow where I can use a key in an Excel file to fetch a single related SQL table row back into Excel? I'm a hard core C# developer but seem to regularly struggle with Excel...
I would import the excel data into a staging table in your SQL Server database.
Of course you can use ADO to get the excel data into SQL Server.
Then you can join the view with your staging table.
hope this helps.

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.

SSIS Import Excel Document Using Column Position, Not Name

I was wondering if it was possible to import Excel documents using SSIS by referencing a column by its position? For example, import columns A,D,M,AA, etc. I ask because I need to load in several Excel documents from a third party. Each document contains the same data type in the corresponding columns, except the column names are different for each document.
Thanks!
Yes but you won't be using the Excel driver and connection manager. Instead, you will use the OLE DB driver and write a SQL Query against the file. For anything but the most basic Excel files, this is my go-to approach for importing data out of Excel.
Various incarnations of my approach
Excel Source as Lookup Transformation Connection
script task in SSIS to import excel spreadsheet
Import a single Excel cell into SSIS

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.