Some thoughts on converting CSV to SQL Server database

Source: Internet
Author: User
Tags bulk insert

Participate in the data contest more than once, many times the official data format given by the game is to record data in CSV format, and then we want to import it into the database, we need to have our database has the ability to recognize the CSV.

I used MySQL and sqlserver,mysql support CSV format import, this people search, method a heap of heap, but SQL Server, you go to search "CSV import SQL Server", the results are some words (BULK INSERT) to deal with the method (here is not to say that the statement processing is not good or something, the key is trouble, how trouble, first csv is comma-delimited data, each row of data has an end sign, some format is ' \ n ', some are ' \ r \ n ', is called tune, We don't have to use UltraEdit to open that big data file and see if the end of each line is ' \ n ' or ' \ r \ n '. There are simple and reliable ways to import data, why is it so complicated and difficult to use? And I use this method of import, you are not easy to search, you can search all the way to use the statement to deal with the trouble of importing data.

In fact, this method is very simple, is to use the database engine to complete (i installed SQL2008 R2), the following we look at the operation of the steps:

  

Figure 1 Creating a database

        

Figure 2 clicking Import data

Next you'll open the wizard to import the data, follow the wizard step by step. Look at the picture ~

          

  

  

  

    

, well, read these, I believe that did not play SQL Server children's shoes can also be made clear, and quickly try it ~ ~ Have any problem can be private messages I ~

                                

Some thoughts on converting CSV to SQL Server database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.