3

I'm not sure what to call a query that... isn't really a query; is "statement" a better word to use in place? Or how about "script"?

Or would something else be more appropriate?

Note: I've seen someone call it a "DELETE query" once

mustaccio
  • 25,896
  • 22
  • 57
  • 72
Drewdavid
  • 145
  • 5

1 Answers1

6

I typically call them DML statements or just statements. Query is commonly used for convenience.

After all, you're issuing a query against the database - if you say...

DELETE dbo.table WHERE id = 5;

...isn't at least part of that a query? What about...

INSERT dbo.table1(col) SELECT col FROM dbo.table2 WHERE ... 

?

And no, I would not call them "scripts" - that implies something else altogether (usually a collection of statements, in a wide variety of languages, and commonly saved to a file).

Aaron Bertrand
  • 180,303
  • 28
  • 400
  • 614
  • I generally use "statement" or "operation". – REW May 02 '14 at 17:54
  • 1
    @REW strictly speaking, I interpret operation as the effect of the statement, not the statement itself. A DELETE operation physically happens because a DELETE statement was issued. The statement on its own does not cause an operation until someone executes it. – Aaron Bertrand May 02 '14 at 17:56