Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Import problems from Excel

Author  Topic 

dmaxj
Posting Yak Master

174 Posts

Posted - 2008-10-23 : 00:56:36
I am trying to import rows from an Excel document that contains 4 sheets. I have defined my SQL Server 2005 database to contain 4 tables and the need datatypes.

I am using SQL Server Management Studio. I start the import process by right-clicking on TASK -> Import and selecting my datasource and destination. The import completes with no errors.

The only problem is that I end up with 4 new tables with the Sheet names+$ attached to each table, AND the datatypes are all incorrect. I am trying to get the EXCEL data into my existing schema.

Regards

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 01:00:14
If you want to use existing tables be sure to map them as destination objects from the export import wizard. To get them as correct datatypes, you've tweak the transformation code and cast them explicitly for those whose datatypes are not correctly interpreted
Go to Top of Page

dmaxj
Posting Yak Master

174 Posts

Posted - 2008-10-23 : 02:24:41
I think that I follow. I did choose to EDIT SQL from the Import Wizard, however, not all rows were imported. I received some error ( I will post later ) - I believe that it was regarding the fact that I changed the name of the excel import sheet to match my existing table in SQL 2005.

I guess I am foggy on where the mapping occurs - I recall that I can choose line one as field names or not. I assume that I do not want field names because they are already defined in SQL prior to the import. I do not see a mapping choice. Am I missing a step?

Regards
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 03:10:55
cant you view code behid which does the mapping between source and destination columns?
Go to Top of Page

dmaxj
Posting Yak Master

174 Posts

Posted - 2008-10-23 : 15:58:14
Finally got it to work.

Thanks visakh16
Go to Top of Page
   

- Advertisement -