What happens “Update” command is used without where clause ?

It will update all the records with same name in the particular field of the table.

If we dont mention “WHERE” clause in the UPDATE statement, it will update all records satisfying the given condition (if given any ) in the table !

Based on query condition. it will update all the fields which are mentioned in the query.
ex: update employee set firstname= @firstname,lastname=@lastname where employee_id =@employee_id.
so in the above case nothing wil be happen if you used where clause or not.
if you have many statements in the query you need to use the where clause.

 Mail this post

Like this post? Subscribe to my RSS feed and get loads more!