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

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).

| improve this answer | |
  • I generally use "statement" or "operation". – REW May 2 '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 2 '14 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.