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
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
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).
operationas the effect of the statement, not the statement itself. ADELETEoperation physically happens because aDELETEstatement was issued. The statement on its own does not cause an operation until someone executes it. – Aaron Bertrand May 02 '14 at 17:56