I'm trying to create a format file using bcp utility following the instructions on this page:
Using a format file to bulk import data
However, this page only discusses how to create format files for tables in the databases. My target is creating a format file for a txt file on my disk and then using the format file to import the raw data in the text file to the database. I tried the following command:
bcp C:\data.txt format nul -c -f txt1.fmt -T
and get the following error:
A valid table name is required for in, out, or format options.
I'm using sql server 2016 and my system is windows 10 64 bit.
Can anyone help me with this, thanks in advance for your help!