Import Flat File - Issue with Column Headings, Data Types

  • This is a bit weird and I am trying to get my head around the issue - hope somebody can point me in the right direction.

    We use something called Snipe IT for asset management - it is a hosted solution (I think it use MySql) - and I have some MI that uses the data but the only way I can get an extract is to create a Report in CSV Format. I believe there is an API but I am not a Developer. What I did back in 2019 was take the CSV and use Task > Import Flat File to create a DB Table from the CSV. I looked at other options to do this but the simplest method was to  drop the table and recreate it from a fresh extract each time. I had to fiddle with Data field lengths (the sample used by Import does not accomodate the longest data fields) - but I made the same changes every time and did it without thinking so this worked for my purposes. Up until 3rd December, when I last ran this, all was well.

    I tried to do this today and had issues with it for the first time.

    I thought it was an issue with Snipe IT data format maybe changing - but testing this with previous Import files that worked, it is doing the same thing and producing the same error.

    So what is this New behaviour?

    When I try to Import the CSV it puts out an error that it does not like the Column Headings and it takes the column data of the first record as the column headings.

    I can open the CSV in Excel, change nothing, save it and the column headings issue disappears.

    However, a result of doing this is that it drops leading zeroes in the column data and also has an issue with data type conversion.

    I can see that the extract has 4 columns called Address and can see why this might be an issue - but in the past it just created Address1-Address4 during the Import with no issue.

    I also see that the data type conversion it complains about when I open the CSV in Excel contains a datetime but is NVARCHAR(50) - but this has always been the case and not been an issue before.

    The SQL box has not been patched or restarted since this last worked on 3rd December (over 2 years since I first did this).

    So nothing has changed, yet I now get an error with current and with previously successful Import data which is baffling me.

    I  even edited the Address column headings with Notepad to make them unique prior to Import - but this did not resolve the issue.

    Been struggling this week with brain fog - but I can not see what the issue is or how it can suddenly manifest.

    Thanks for any pointers.

    Steve O.

     

     

  • OK - I think it is now working as before.

    It is working in SSMS 18.8 but not n SSMS 18.4 - I am not sure what has happened to the icons and saved credentials but this is inside a Citrix enviroment using Published Apps and MCS desktop which has confused things as I am sure that I have been using the same version of SSMS for a while.

    Always seems to be the way to focus and fix something - write a post on a forum......

  • This was removed by the editor as SPAM

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply