bbsimonbb/query-first

insert into <table>... does not work

Closed this issue · 6 comments

Hi,
For me I get:
"Unknown problem generating insert." when I save a QueryFirstQuery file with "insert into

...". I have tried it for multiple tables with the same result. It is a .net core console application in VS2019. "Update
..." is working fine. The database is SQL server 2014.

Just a hunch...can you make sure your tables have Primary Keys.

Hi, all the tables have primary keys (not auto_increment) but they are multi column primary keys, could that be the issue?

Most likely. The 'auto' insert generator needs to know which column to use as the return value's name and data type. It does this by looking for the identity column. Otherwise, just construct the insert statement manually and not try to auto generate it.

oy oy oy. I haven't looked at this for a while, and the generation is done with SQL, when I would be much more comfortable doing it in C#. I will have a look at this v.soon. Thanks for raising the issue.

This is completely rewritten in the 1.1.0 release.

I see market place has been updated, awesome, thanks! 👍