Home Forums SQL Server 2012 SQL 2012 - General Database import from text/csv file and many to many relationship RE: Database import from text/csv file and many to many relationship

  • Thank you for this very well explained answer and that useful link.

    Sorry for the ambiguity, but unfortunately I'm also having problem with the import, in fact, it is my main problem.

    I'm just trying to import a CSV file to the database and getting the result shown on the second image, which is as you can see not a excel sheet (the first one is) but the real sql table, from the visual studio 2012 sql table manager, so that's what I wanted to say, the fastest way that I found to import all my articles was to add them one by one using VS2012 SQL Manager as I don't know how to import the CSV file..)

    Here is that CSV file :

    Article ID;Tags ID

    1500;7,8,9,5

    1501;4,3

    1502;8,1

    1503;8,9

    ....

    Columns are ";" separated and tags id are "," separated.

    So if I've to import this CSV file to "MyTable"

    Article ID;Tags ID

    Jeff;Moden,Zidane,Headbutt

    5;1,4,6

    This would be the structure expected after the import :

    But I do not have a clue how to do it.