SQL-Server-Update .

In this session i have discussed the SQL Server Update keyword .


The SQL Server Update keyword is used to modify the existing records in table .


Update Syntax .

The below code specify how to use the Update .

    UPDATE Table_Name SET Column1=value1 , Column2=value2.....
    WHERE Condition
    


Database Demo

The following data shown by Employee table of abc database .

EmpID EmpName EmpCity EmpEmail
1 Amit Noida amit@gmail.com
2 Amita Noida amita@gmail.com
3 Amita Delhi amita123@gmail.com

Update Example .

The below sql code modify the EmpName as Abhishek and EmpCity as Gorakhpur of Employee their EmpID=1.

    UPDATE Employee SET EmpName='Abhishek' , EmpCity='Gorakhpur' WHERE EmpID=1
    

The output is look like below .

EmpID EmpName EmpCity EmpEmail
1 Abhishek Gorakhpur amit@gmail.com
2 Amita Noida amita@gmail.com
3 Amita Delhi amita123@gmail.com

.


Welcome to AndroidATPoint.

back image                     next image