Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9203473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:28:53+00:00 2026-06-17T23:28:53+00:00

I want to create an export to an Excel file. For this I use

  • 0

I want to create an export to an Excel file.

For this I use this code:

INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 
'Excel 8.0;Database=C:\Temp\65343\file.xls;',
'SELECT group,subgroup,name_product,manufacture,unit,
retail_price,wholesale_price,info FROM [ExportSheet$]') 
VALUES 
('name','name','name','name','name','0.00','0.00',''),
('name','name','name','name','name','0.00','0.00','');

But I get this error:

Msg 257, Level 16, State 3, Line 2
Implicit conversion from data type varchar to varbinary is not allowed.
Use the CONVERT function to run this query.

Tell me please why i have error and how right write this code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:28:54+00:00Added an answer on June 17, 2026 at 11:28 pm

    Your syntax looks correct to me, so I have a few observations.

    That error generally means you are having a data type conversion issue — in this it looks like one of your fields in your excel file is expecting a varbinary field but is receiving a varchar field instead.

    Does it work if you limit the fields to just one, say group? If so, you can figure out which field is the culprit.

    Alternatively, instead of using VALUES clause, can you use a temp table:

    INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 
    'Excel 8.0;Database=C:\Temp\65343\file.xls;',
    'SELECT group,subgroup,name_product,manufacture,unit,
    retail_price,wholesale_price,info FROM [ExportSheet$]') 
    SELECT group,subgroup,name_product,manufacture,unit,
    retail_price,wholesale_price,info FROM YourTempTable;
    

    Not sure this will help, but I’ve never used INSERT INTO OPENROWSET explicitly supplying the values — seems like it should work though.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I want create a excel with Apache POI in java and I must insert
I want to export a CSV file to a datagridview. I need to create
I want create wordpress website into which I want create user management... That means
I want to export some data from my jruby on rails webapp to excel,
I'm using Apache POI to export data to a .xlsx file and I want
I'm trying to create an export Excel/CSV function that will iterate through a custom
When the user clicks on the Export to Excel link, the standard File download
I want to export to excel, but I want the data to print in
I want to export the chart which is created with mschart to excel. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.