Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL server: difference between DELETE <Table> and DELETE from <Table>

SQL server:
Difference between :

Delete tblxyz where id=6 

and :

Delete from tblxyz  where id=6

Is their any difference between above queries ?

like image 580
Manish Vij Avatar asked Jun 05 '26 00:06

Manish Vij


2 Answers

enter image description hereThere is no difference if you see the execution plan both generates delete scripts as below

DELETE [testtable]  WHERE [numbers]=@1
like image 131
Kannan Kandasamy Avatar answered Jun 07 '26 23:06

Kannan Kandasamy


There is no direct difference between the two statements (except that I find the "DELETE FROM" easier to read and understand)

note that ANSI does require the "FROM" keyword as stated by jarlh

see also https://msdn.microsoft.com/en-us/library/ms189835.aspx

like image 44
Razieltje Avatar answered Jun 07 '26 22:06

Razieltje