MS Access SQL DELETE - why would anyone give column names?

I need to maintain an Access.mdb file that someone wrote. One of the button functions in this .mdb is to delete some data in an external MSSQL database. Everything is very simple, but this syntax is not what I saw before:

DELETE tblEquipmentConnections.SourceEquip, tblEquipmentConnections.EquipmentConnectionID FROM tblEquipmentConnections WHERE tblEquipmentConnections.SourceEquip = [Forms]![frmEquipment]![EquipmentID]; 

Is this something other than that?

 DELETE FROM tblEquipmentConnections WHERE tblEquipmentConnections.SourceEquip = [Forms]![frmEquipment]![EquipmentID]; 

I can't find a case where specifying specific columns does anything, but I don't spend a lot of time accessing, so I'm not sure how different the SQL syntax is ...

Thanks!

+4
source share
4 answers

Specifying column names does not matter. This is just an affordable thing.

The reason they may exist is because Access is used to generate DELETE statements this way (not sure what it still does).

The second form without column names is obviously preferable.

+2
source

I think the query was built directly into the Access query editor.

And usually we start by creating a select query. Then we change the type of request from “Select Request” to “Delete Request”. Then we output the query source by selecting "SQL Mode", where we copy / paste the sql statement like this:

  DELETE qc_Boxes.idBox, qc_Boxes.idScreen, qc_Boxes.title FROM qc_Boxes; 
+1
source

This is completely redundant. The space between DELETE and FROM is used only when the deletion is performed on the basis of a condition with several tables, but even then it contains table names, not field names. It may also contain *, which is also redundant. In MySQL, for example, this is the wrong syntax.

0
source

Because they do not know what they are doing?

-3
source

Source: https://habr.com/ru/post/1298995/


All Articles