I have a series of fixed width text files. A sample of the data is given below. The files are originally given names such as xyzjob123456.678x.
The end result should look like this
With the schema being as such
I am reasonably sure that I have to use a format file and so would start out as such:
Would the following format file layout be correct? Also, I know that the 6th column (1,2,1,2..) is incorrect. Does anybody know what this represents?
Here is the list of problems with your format file:
Here is the format file which works with your sample data. In my case the SQL Server version is 2016 so I use 13.0 in the first line. Also, the syntax of the bulk insert in question is invalid, it misses parentheses around the format file specifications. Here is the script and format file which work:
Hope this helps.