Solved

SSIS unable to import Excel data into table

Posted on 2014-09-08
4
557 Views
Last Modified: 2016-02-11
Hello Experts Exchange
I have a Excel file that I'm trying to import into SQL Server 2012 using SSIS.  The file looks fine but I'm unable to import data from the columns called "Overtime (hrs)" & "Late / Ely off (hrs)".

I have attached a sample file to show you the data, can anyone help me to get the data into SQL Server please?

Regards

SQLSearcher
Sample-Data.xls
0
Comment
Question by:SQLSearcher
  • 3
4 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40309717
For starters, see if you can lose the ( ) / from the column headers.
Also, in the Excel connection eyeball what the data type is.

Also make sure that all of the columns can accept NULL values, and make sure that the number columns don't have any empty string '' instead of NULLs.

As an aside, it's a good practice to pump rows into a 'staging' table that has all varchar() column data types.  This provides the best odds that all rows will successfully make it into SQL.   Then you can execute T-SQL to verify that dates are dates, numbers are numbers, handle NULL values, etc. correctly before pumping into the final destination table.
0
 

Author Comment

by:SQLSearcher
ID: 40310118
Hello Jim

I tried to import the data into a staging table where all the columns where set as varchar and it came up with the error of;

Found 4 unknown column type conversion(s)
You are only allowed to save the package


How do I import the data by setting all the columns to varchar?

Regards

SQLSearcher
0
 

Accepted Solution

by:
SQLSearcher earned 0 total points
ID: 40332177
Hello Experts Exchange
I have solved the question myself, I had to change the data to text format.

I did this by gong into Excel select the column i could not import, then select data from the excel menu then select text to columns, and then select Next, then select next, then select text then click on finish.

Regards

SQLSearcher
0
 

Author Closing Comment

by:SQLSearcher
ID: 40338606
Solved question myself please see answer.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RESTORE A BACKUP IN SQL 2012 from SQL 2008 9 65
Problems "swapping" SQL Server DBs 2 20
SQLCMD Syntax 2 15
Getting invalid Syntax SQL. 3 20
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question