views:

40

answers:

2

say I have a table named XY_values with columns X_values and Y_values.

now, I have a text file xy.txt which contains those x values and y values, with x values in the 1st column and y values in the second column.

is there any SQL command to load those x and y values from the text file into the XY_values table in the database?

thanks.

A: 

Microsoft SQL Server has an import facility which can read text files and import them as tables, or even send them off to another datasource. In fact, I remember quite a few managers buying SQL 7 on the strength of that functionality.

Jonathan
A: 

I would look into using SQL Server Integration Services (SSIS) to do this. Here is a good link that goes over importing data from a text file using SSIS.

Abe Miessler
see http://support.modwest.com/content/6/253/en/how-do-i-import-delimited-data-into-mysql.htmlI am using MySQL database, but regardless whether MySQL or MS SQL Server, it should work.LOAD DATA LOCAL INFILE '/importfile.txt' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3); Above is for fields terminated by comma, how about fields terminated by space?I try this, but it does not work, why?FIELDS TERMINATED BY ' '