Richy
Richy

Reputation: 21

Exporting db table from SQL Server 2008 R2 to Excel 2007

SQL Server 2008 R2 (management tool, not coding as I'm a bit of a noob) to Excel.

I need to export info from my db table COMPANY (some feilds varchar(50) some nchar(10)) to an Excel spreadsheet which i just created as normal - Excel > New > Blank.

Everything seems to be straight forward but just cant see the problem... Please see below and thanks a million in advance :)

Pre-execute (Error) Messages Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21. (SQL Server Import and Export Wizard)

Error 0xc0202025: Data Flow Task 1: Cannot create an OLE DB accessor. Verify that the column metadata is valid. (SQL Server Import and Export Wizard)

Error 0xc004701a: Data Flow Task 1: component "Destination - COMPANY" (37) failed the pre-execute phase and returned error code 0xC0202025. (SQL Server Import and Export Wizard)

Executing (Warning) Messages Warning: Preparation SQL Task 1: Multiple-step OLE DB 

operation generated errors. Check each OLE DB status value, if available. No work was done. (SQL Server Import and Export Wizard)

Warning: Preparation SQL Task 1: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. (SQL Server Import and Export Wizard)

Copying to COMPANY (Stopped)

Post-execute (Stopped) Messages Information 0x4004300b: Data Flow Task 1: "component "Destination - COMPANY" (37)" wrote 0 rows. (SQL

Server Import and Export Wizard)

Upvotes: 2

Views: 5858

Answers (2)

Michael Sobczak
Michael Sobczak

Reputation: 1085

When you're in the import wizard, at the point you've selected the table or view to export, click the [Edit Mappings] button. What solved my problem was to change the fields with an export data type of "Long Text" to "VarChar" 255 characters.

Upvotes: 2

dhiraj dakhore
dhiraj dakhore

Reputation: 1

Your source table might contain some column with NVARCHAR data type that’s why you are getting this error.

It’s not good solution still i will give try to change data type of column from NVARCHAR TO VARCHAR.

Thanks Dhiraj

Upvotes: 0

Related Questions