Link to home
Start Free TrialLog in
Avatar of CityofDelrayBeach
CityofDelrayBeachFlag for United States of America

asked on

SQL Server Import and Export Wizard Errors

I'm getting the attached errors when I run my query through the SQL Server Import and Export Wizard (SQL 2008R2).  

I'm extracting table date to Excel.  When I run the query via SSMS it runs fine. When I look at the Preview inside the Wizard it looks fine.  I ran the same query on a smaller database and it ran fine. I know it has to do with size/number of records. It fails somewhere after row 65000. There are over 200000 rows.

Anyone have any idea how to fix this? I've read much online but can't get an fix specific to my issue. Someone mentioned in a post that in the Column Mappings the Source Type-Destination type entries might be causing it and need to be modified (example: Column Source Type=varchar, Destination Type=LongText).

Any help is greatly appreciated.
ExportContactsReports.txt
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CityofDelrayBeach

ASKER

Hi Kevin. Thanks so much for your response.

As mentioned in my original post, it works in SSMS but not in Export Wizard. The query also works on a smaller database (which exactly the same, just less records) but not on the larger one.  Thus, I'm certain it has something to do with the number of records.

I have read the article about Temp directory permissions.  Unfortunately, it is not specific. I would have to call Microsoft to clarify exactly what they are talking about. I've sent Feedback on that article to this effect.

I'm looking at the other article now.
Sorry.  I focused on the error being SSIS.  I see you actually are using the Export wizard, which creates an SSIS package automatically.  I have run large tables through Export before, but you may be hitting a file limit.  What file are you going to (e.g., Excel)?  If Excel, what version?
Argh.  Not enough coffee today.  I see you specified Excel, so my questioning was to point out that Excel 2003 has a row limit of 65,536; therefore, you may be seeing a failure because of that.  Try exporting to Excel 2007 or a CSV file to see if it works for you.

EDIT: if the CSV approach works for you, you can split the file to work with Excel 2003.  Otherwise, you can pull data in batches of 65K and store in a different Excel file.
Here is how the error should look if I am correct.

Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft JET Database Engine"  Hresult: 0x80004005  Description: "Spreadsheet is full.".
 (SQL Server Import and Export Wizard)

If I export the same table to Excel 2007, it works just fine.  It has over 200K rows.
Hi again, Kevin.

I've was originally using Excel 97-2003 because I didn't have the Access Database Engine installed, but I installed the ADE and chose Excel 2007 (which is the latest listed in the drop-down) but get the same errors.

I exported to CSV now using"Flat File Destination" in the drop-down and it went though.  149,000 rows.

It's just soooo annoying how cryptic Microsoft errors are! Why not just say "too many records"?

But what still doesn't make sense is why there is a limit when I'm using Excel 2007.
OK, so something isn't right.  the csv file doesn't have the data correct in some of the columns.  It says $GROUP instead of the actual data.

I may need to call Microsoft on this one.  It doesn't make sense why the export isn't working.
I agree.  I will double check as I may have Excel 2010, but still should have worked for you.  Please update the thread if you get a good explanation from Microsoft.  It will be helpful to others who may run into this.
I am going to close this and open a new thread because I have to start over. I'm not getting the results I need with my queries. I'm not sure whether I need to use JOIN or UNION to get the results I need.

Thanks for all your help.
Okay.  I see Sharath already is helping you with that.  As an aside, I find that sometimes it works well to use the query functionality of Excel to pull data versus to push from SQL Server.

Anyway, best regards, Kevin
Hi Kevin.  Yes, I tried that but I'm still stuck on how to combine all the data into one worksheet when there are multiple JOINS.  Can you help?