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