Create a new table and import the data from the csv file into SQL Server 2005

I have several files of 15 to each of the CSV data that I need to import into SQL Server 2005.

What would be the easiest way to import csv data into sql server? Ideally, a tool or method would also create a table, since there were about 180 fields in it, this would simplify things.

+3
source share
3 answers

BULK INSERT- your friend. Sort of:

BULK INSERT MyTable 
    FROM 'c:\data.csv' 
    WITH 
    ( 
        FIELDTERMINATOR = ',', 
        ROWTERMINATOR = '\n' 
    )

EDIT

BULK INSERT . SQL Server, . http://www.kodyaz.com/articles/import-csv-flat-file-into-sql-server-using-ssis-integration-services.aspx .

+9

" " SQL Server. → SQL Server 2005 → (32) (64)

+3

MSSQL: 1) MSSql Menagement Studio, "", 2) " ", "" 3) " " csv, .

in my experience, sometimes csv arn't imported correctly, so if you can, convert it to an excel file and select "microsoft excel" in the data source

+2
source

Source: https://habr.com/ru/post/1745368/


All Articles