---
title: "How to Update table data in SQL Server using command?"  
description: "How to Update table data in SQL Server using command?"  
author: "Ethan Karla"  
published: 2021-09-14  
canonical: https://answers.mindstick.com/qa/93951/how-to-update-table-data-in-sql-server-using-command  
category: "database"  
tags: ["database", "database management system"]  
reading_time: 2 minutes  

---

# How to Update table data in SQL Server using command?

How to [Update](https://www.mindstick.com/forum/156355/what-is-google-pigeon-update) [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) [data](https://www.mindstick.com/articles/23186/how-becoming-a-data-analyst-can-be-a-lucrative-career) in [SQL Server](https://www.mindstick.com/articles/12343/sql-server-2017-ctp-2-0-now-available) using [command](https://www.mindstick.com/interview/36/what-is-the-use-of-alter-table-command-in-database)?

## Answers

### Answer by Ashutosh Kumar Verma

**[SQL](https://www.mindstick.com/articles/202/the-detailed-concept-of-stored-procedure-in-sql-server) UPDATE Statement –** The ‘update’ statement is used to modified the existing record in a table. In this case notice the WHERE clause. Data are modified where the WHERE clause fulfill the condition. If we don’t provide WHERE clause in UPDATE statement then all data will changed. **Syntax**- UPDATE tablename SET column1=value1, column2=value2,…. WHERE condition; Bellow the example of UPDATE statement in a table. Record of the table are as- ![How to Update table data in SQL Server using command?](https://answers.mindstick.com/questionanswer/00e53f42-ae16-45a3-a4c3-80f3682068e0/images/5fda81be-82f3-44bd-952c-6438e374da79.png)\
Following statement is UPDATE the stuCourse ‘Marketing’ to ‘Marketing Course’ of ‘StudentData’ table where Id is 103. update StudentData set stuCourse ='Marketing Course' where Id=103; ![How to Update table data in SQL Server using command?](https://answers.mindstick.com/questionanswer/00e53f42-ae16-45a3-a4c3-80f3682068e0/images/2603dccd-186b-46e8-8260-7dffc9a7b6ce.png) \
UPDATE multiple record of ‘StudentData’ table. We can also assign value in that field which contain NULL value. Following statement modified the ‘stuName’ and ‘stuCourse’ of ‘StudentData’ table where Id=104. update StudentData set stuName='Sundar', stuCourse='B.Tech' where Id=104; ![How to Update table data in SQL Server using command?](https://answers.mindstick.com/questionanswer/00e53f42-ae16-45a3-a4c3-80f3682068e0/images/9d8d464b-a128-4679-841b-16df48665305.png)\
If you forget the use WHERE clause in UPDATE statement then you find the result like as- update StudentData set stuCourse='Software Trainee'; ![How to Update table data in SQL Server using command?](https://answers.mindstick.com/questionanswer/00e53f42-ae16-45a3-a4c3-80f3682068e0/images/59c8c064-a1ac-4f5b-a28d-48488d0323ea.png)\


---

Original Source: https://answers.mindstick.com/qa/93951/how-to-update-table-data-in-sql-server-using-command

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
