Skip to content

MSSQL Server - Delete query syntax error, mssql does not like the table alias in the delete statement #583

@rbygrave

Description

@rbygrave
  ebeanServer.createQuery(MachineCycleEvent.class, "where machine_cycle_id = :machineCycleId")
  .setParameter("machineCycleId", machineCycleId)
  .delete();

Errors with:

[info] - deletes all cycle events by the machine_cycle_id *** FAILED *** (20 milliseconds)
[info]   javax.persistence.PersistenceException: Query threw SQLException:Incorrect syntax near 't0'.
[info] Bind values:[1829]
[info] Query was:
[info] delete from machine_cycle_event t0 where machine_cycle_id = ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions