Search code examples
cmdsql-server-2014bcp

Importing data with bcp


I would like to import data in the file 'c:_value_.txt' to my database like this

Bcp mydb.mytable in 'C:\_value_.txt' -T -c -Smypc\instancename

However I keep getting the error Unable to open BCP host data -file Why is this?


Solution

  • Lose the single quotes around the filename. Either use no quotes, or use double quotes ("") if the name contains spaces and such.