I am trying to BCP a file into a table that has the same columns as the file being brought in
BCP command
EXEC xp_cmdshell 'BCP [CMS_Data].[dat].[SNP_2019_02_Special Needs Plan Report_RAW] in "\\FileShare\datafeeds\CMS_ResearchStatistics\Temp\SNP-2019-02\SNP_2019_02_Special Needs Plan Report.csv" -t"|" -T -c -F2 -S MSSQLSERVER'
I am getting this error
Copy direction must be either 'in', 'out' or 'format'.
I am using F2 to skip the header row the error states I need a in, out or format but the in is clearly there. This must be some other issue I am not seeing. This code worked prior. I changed the F2 to F18 since that is where the data started on the file. Since that seemed like an issue I moved data to line 2 but now it does not work there either.
bcp
can't parse its command line (it's extremely finicky that way). If necessary retype the command to ensure no invisible spacing characters or strange encoding has crept in. Also try-F 2
(with an explicit space), even though that should not matter, and try changing the order of the parameters. – Jeroen Mostert