There is a table with the following columns:
ProdID
Specification
Value
I’ve got a csv file with a schema that only has the last two columns – Specification and Value. In other words they are my csv headers. Now I need to associate the values of this file against one unique id.
The significance of that id is that it is a reference to the document; its not important here, but, for now assume it is reqired by the system.
Now while I use the SqlBulkCopy class to insert is there a way that I can still insert some value for ProdID such that each row inserted will have the same ProdID for that file I am trying to bulk copy…?
That depends. if
ProdIDis anidentityfield in the database, the database will fill it for you when you perform the bulk copy.If it’s not, you will need to fill it yourself and pass the three columns to
SqlBulkCopy, instead of just the two.