mtanneryd / ef-bulk-operations

Bulk operations for Entity Framework 6
Apache License 2.0
80 stars 30 forks source link

BF: Quote the column name of the Insert from the temp table into the target table #6

Closed Chralex closed 6 years ago

Chralex commented 6 years ago

Hi there, I ran into some issues when using this since I'm using some not ideal column names for a table that is used to hold integration data. To be more specific I have a column named "Key", which is a SQL keyword. As said earlier I only chose that name because the provider uses the same name for their column in another database.

This basically prevents the SQL-interpreter from reading the column name as a keyword.

For posterity here is the exception that I got:

System.Data.SqlClient.SqlException: 'Incorrect syntax near the keyword 'Key'. Incorrect syntax near the keyword 'Key'.'

charactersynchronization_ debugging _-_microsoft_v_2018-08-11_03-49-58

And that is because my table-class looks like this:

charactersynchronization_-_microsoft_visual_studio_2018-08-11_03-52-09

I realize that it is possible that you intended that the developer should solve this by providing their own column mapping via an attribute?

p.s. I see that you fixed some garbage collection issues, please make a release package for them. Thank you.

mtanneryd commented 6 years ago

Hi!

Thanks for the feedback and the suggested changes. I was about to build the 1.2.0 release of the package but I have been a bit delayed since the windows 10 1803 update killed my Dev laptop.

Chralex commented 6 years ago

Sorry to hear about your laptop. Last time a windows update damaged one of my machines was back in the Windows Vista days, where upgrading the service pack caused my sound card to stop working. That was pretty annoying.