I have a Comma separated CSV file containing ID, FirstName, and LastName. I am trying to insert it into my existing table, however the table has few more column which the CSV file is missing thus I am wondering if it's possible to insert the CSV file combined with manual value mapping ?
Below is how my table looks like:
And this is how my CSV file looks like:
As you can see, the CSV file only contains the IdentityId
column of the Table (is's called Id
in the file) and Email
and other fields are missing, therefore I am wondering if I can manually provide them or I need to insert the bulk item first, and then write a command to update all of them?
Best Answer
A possible solution is to use OPENROWSET
Assuming a csv file (emp.txt):
Assuming a format file (format_file.xml):