Web888.vn
  • Shop
  • Blog
Đăng nhập
  • Đăng nhập / Đăng ký

Please enter key search to display results.

Home
  • Micrsoft SQL Server
  • Technology News
Update command in SQL Server

Update command in SQL Server

  • 24-07-2022
  • Toanngo92
  • 0 Comments

The update command uses the update of existing data in the table (a certain record or list of records), usually updating according to a primary key condition, or a certain condition. If you do not enter the condition, it will update all records in the table.

Syntax:

 UPDATE table_name SET column_name1 = expr1, column_name2 = expr2, ... [WHERE condition];

Explain:

  • table_name: the name of the table that you want to update the records for
  • column_name: the name of the column you want to update
  • value: define a new value for the column to be edited
  • WHERE condition: a condition that defines the purpose of filtering the records to be updated.

For example:

 UPDATE Person.PersonPhone SET PhoneNumber = '731-511-0142' WHERE BusinessEntityID=299 AND ModifiedDate ='2020-10-12'

In the above example, I update the phonenumber for the record in the PersonPhone table, with the condition that BusinessEntityID = 299 and ModifiedDate = '2020-10-12'

If I don't specify the WHERE condition, the entire PhoneNumber column data of the PersonPhone table is updated to '731-511-0142'

Bài viết liên quan:

Introduction to Transact-SQL (T-SQL)
Introduction to Microsoft SQL Server
Create and administer the database, create users in SQL Server
Common Table Expression (CTE) – Common Table Expression in SQL Server
Combine Data Using (SET OPERATORS) UNION, INTERSECT, and EXCEPT in SQL Server
SQL Server Pivot and Grouping Set Operators
Programming and control of flow in Transact SQL
Transaction in SQL Server
Subqueries (subqueries) in SQL Server
SQL Server GROUP BY clause
Index in SQL Server
Entity-relational model (ER model) and data normalization (normalization)

THÊM BÌNH LUẬN Cancel reply

Dịch vụ thiết kế Wesbite

NỘI DUNG MỚI CẬP NHẬT

Step-by-step guide to installing Microsoft SQL Server and connecting to the database for beginners

Reasons Why People Are Increasingly Inexperienced in Life

PHP Data Types

Table (table) in SQL Server

Basic data types in C

Giới thiệu

web888.vn là chuyên trang chia sẻ và cập nhật tin tức công nghệ, chia sẻ kiến thức, kỹ năng. Chúng tôi rất cảm ơn và mong muốn nhận được nhiều phản hồi để có thể phục vụ quý bạn đọc tốt hơn !

Liên hệ quảng cáo: [email protected]

Kết nối với web888

© web888.vn - Tech888 Co .Ltd since 2019

Đăng nhập

Trở thành một phần của cộng đồng của chúng tôi!
Registration complete. Please check your email.
Đăng nhập bằng google
Đăng kýBạn quên mật khẩu?

Create an account

Welcome! Register for an account
The user name or email address is not correct.

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

Registration confirmation will be emailed to you.
Log in Lost your password?

Reset password

Recover your password
Password reset email has been sent.
The email could not be sent. Possible reason: your host may have disabled the mail function.
A password will be e-mailed to you.
Log in Register
×