Why 'Select' is called as DML statement ?
Solution 1
The distinction that people usually make is between DDL (data definition language, i.e. managing schema objects) and DML (data manipulation language, i.e. managing data within the schema created by DDL). Clearly a SELECT is not DDL.
Solution 2
Data Manipulation Language (DML) is a vocabulary used to query/retrieve and work with data. Don't go by the word Manipulation, such statement allows both data accessing and processing. As you have tagged question with SQL Server 2005 following link can be referred:
http://technet.microsoft.com/en-US/library/ms177591(v=SQL.90).aspx
Solution 3
The SQL Standard considers SELECT part of "Data Manipulation".
An early version of the standard is available online at http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
In section 13, "Data Manipulation" is defined.
Solution 4
Why Select is DML statement in SQL?
The SELECT ... INTO form is manipulates or modifies the data.
For eg
SELECT Column1, Column2 INTO DestinationTable
FROM
SourceTable
Copy Coumn1,Column2 From SourceTable to DestinationTable.
So Select is dml statement
saTech
Updated on November 28, 2020Comments
-
saTech over 3 years
I see lot of debate of 'Select' being called as DML. Can some one explain me why its DML as its not manipulating any data on schema? As its puts locks on table should this be DML?
*In Wikipedia * I can see
"The purely read-only SELECT query statement is classed with the 'SQL-data' statements[2] and so is considered by the standard to be outside of DML. The SELECT ... INTO form is considered to be DML because it manipulates (i.e. modifies) data. In common practice though, this distinction is not made and SELECT is widely considered to be part of DML.[3]"
But in SELECT * FROM INSERT select will just perform selection nothing other than this!! Please someone help me in understanding this concept.
Thanks