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 8996951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:49:22+00:00 2026-06-15T23:49:22+00:00

my problem is i can’t import an excel.cvs file to my sql database, because

  • 0

my problem is i can’t import an excel.cvs file to my sql database, because it does not have an index key.

here is the database structure:

+-----+------+-----+-----+---------+------+-------+----+
|from | to   |cont |desc |date_time| total| amount| id |
+-----+------+-----+-----+---------+------+-------+----+

id being the primary with auto increment.

content of cvs file:

12345678910 17071234569 UNITED STATES OF AMERICA    California  12/15/2012 2:41   4:00  0.04536
12345678910 17861234569 UNITED STATES OF AMERICA    Florida     12/15/2012 2:41   4:00  0.076

cvs in notepad ++:

12345678910,17071234569,UNITED STATES OF AMERICA,California,12/15/2012 2:41,4:00,0.04536
12345678910,17861234569,UNITED STATES OF AMERICA,Florida,12/15/2012 2:41,4:00,0.076

when i import the cvs to my database, it always says i’m missing 1 colum which is the ID,
but when i make an ID column it always says there is no data on that column, and when i input a value on the ID column in the CVS file the ID on my database gets mixed up.

ex:

+---+
|ID |
+---+
|1  |
+---+
|   |
+---+
|1  |
+---+
|2  |

what can be the solution here so that i can import my cvs even if it does not have an ID column, and the files that are imported to the database will get an ID automatically.

  • 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-15T23:49:23+00:00Added an answer on June 15, 2026 at 11:49 pm

    Let me explain in simple terms. Your table need 8 arguments and you are giving it only 7. It is possible when you are inserting a record using insert statement. In case of import you must have to give all the column details. You can’t leave a column even if it is auto-incremented. So you have to give the ID column your self.

    Here is my suggestion: I don’t know how you got the CSV file but you can very much open the CSV file in MS-Excel. Now you know how easily you can add a column there and you can generate sequence there in just multiple click.

    After inserting records in your table you can know how many rows you have. Now use this command in the SQL prompt or you can always find one SQL prompt in your PHPMyAdmin:

    ALTER TABLE t AUTO_INCREMENT = <number_of_rows+1>;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a database and have run into a problem that I can't seem
I am facing a problem - can not update the price of the variant
No foreign keys defined in the database. So I've setup associations. problem: can't seem
I have a problem and can't find a solution. I am making an accordion
I have a problem and can't solve it alone. My teacher gives me one
I have a problem - i can't compile SqlCipher. I'm using this http://groups.google.com/group/sqlcipher/browse_thread/thread/55c6296b56bf4533/c792bbec6df7d4f4?tvc=2#c792bbec6df7d4f4 instructions
Hello! My problem can be described the following way: I have some data which
I have tried to understand and use urlencode, but the problem can't be solved.
My Analysis Services database is responsing really slow after processing. The problem can be
I am just facing a problem,can not able to overcome(make be lack of proper

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.