One row data should create table schema with that row

Heh... Actually, it's not impossible if there's always at least one blank line above the second section and the second section will always start with column headers. I've had to do this many times and I'm working on doing the same for this problem over on SSC. I just keep getting interrupted by work.

2 Likes

It's not the ON PRIMARY thing. It's the fact that you didn't define the length of the NVARCHAR column and the default width isn't wide enough and so the inserts result in truncation. Again, if you executed your own code, you would see all that. :wink:

2 Likes

Heh... what are the odds of a similar post showing up on a different forum by a different person? I'm starting to think this might be a homework or exam problem from some university. :frowning:

Check it out here...

https://stackoverflow.com/questions/61580198/ssis-import-csv-which-is-part-structured-part-unstructured

But dad you previously said the above.
And now you are saying "if there's always at least one blank line above the second section and the second section will always start with column headers":smile:

BWAAAA-HAAAAA!!!! Even people that don't understand the concept of consistent data in a file are prone to certain habits. :smiley:

Ok Thank you Boss.. But we need to find 2 ways , find the cama delimiter count in each row and calculate percentage make sure that greater than > percentage first row will be header and again find if there is any int or date data type string is there in that row if not then it is a header.. I am sorry this is big efforts to put on this task.. if any possibility is there please help me