Question:
What happens when “Update” command is used without where clause?
Answer:
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 will be happen if you used where clause or not.
if you have many statements in the query u need to use the where clause. Source: CoolInterview.com
Once the UPDATE statement is executed all records in the table will be updated because there is no condition. Source: CoolInterview.com
Answered by: Jun-Jin | Date: 1/1/2008
| Contact Jun-Jin
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|