I need to transfer some data from a file .txt to a SQL Server.
I use bcp tool. The problem is about a column named 'FILE', that I've
declared as:
[FILE] VARCHAR(150) NOT NULL
The command I launch is the following:
bcp.exe EC_CUNEO01.PROJECT.ANTRACCIATO in data_file.txt -f
format_file.fmt -e error_file.err -m 10 -t\t -r\n -k -b1000 -U user -P
password -S server
In the format_file I've declared the format of the columns, referring to the
'FILE' one as:
3 SQLCHAR 0 150 "\t" 3 [FILE]
But when I try to import the data, the system returns the error:
SQLState = 37000, NativeError = 156
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near
the keyword 'FILE'.
Does anybody know why?
Thank you.