2

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!

Hanna
  • 10,315
  • 11
  • 56
  • 89
  • In other words, you've got a .csv file? 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/ – Marc B Apr 20 '11 at 04:26
  • Yes, a .csv file, sorry! – Hanna Apr 20 '11 at 04:26
  • @Marc B - could you submit that as an answer? That's exactly what I needed – Hanna Apr 20 '11 at 04:40

2 Answers2

-3

You can use Management Studio to import the data in the file into a table.

pjwilliams
  • 300
  • 2
  • 10
  • Sorry, but he was very clear in his question: he wanted to use Sqlcmd. And you didn't ever explain how to do it with Management Studio. – Daniel Marín Sep 03 '15 at 08:50