Search code examples
csvsqlcommandsqlcmd

Read in a txt file using sqlcmd?


Is it possible to read in a txt file using sqlcmd, to avoid needing to type every cell by hand?

I've been given a txt file with every table row on one line, and every column seperated by a comma. (a .cvs file)

I've been trying to look up some commands but ... no luck!

Any and all help would be greatly appreciated!


Solution

  • As requested: http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/