When I use the query builder (lets say on a text field) I get the returned index value.
When trying to duplicate this in script, how to do i get the OUTPUT Inserted.ID into a variable?
Edit:
So ultimately I’m trying to insert a record into a (MS) SQL table, get the unique index (PK) and use that index value for another insert into a daughter (FK) table. Maybe my approach is totally off…
caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO Shipping_Form ([Requestor Badge Number], [Purchase Order Number], [RMA Number], [Ledger Code Number]) Output Inserted.ID VALUES (?,?,?,?), [55425, 123, 123, 123], , , true, false)
caused by GatewayException: SQL error for “INSERT INTO Shipping_Form ([Requestor Badge Number], [Purchase Order Number], [RMA Number], [Ledger Code Number]) Output Inserted.ID VALUES (?,?,?,?)”: A result set was generated for update.
caused by SQLServerException: A result set was generated for update.
May I ask where you found that? Seems pretty obscure.