Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the operation of adding, deleting, changing and searching in sqlserver

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

What this article shares with you is about how to add, delete, modify and check operations in sqlserver. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

One Insert statement

1. Insert only default values in the data:

Insert into [DBTrain] .[dbo] .[log _ info] default values

two。 In the field that can be null, if you want to set null, press [Ctrl+0], note that zero is not o, and press [Esc] if you want to restore the value before modification.

Two Update statements

You can update the data of the first few items or a certain percentage.

Update top (3) [log_info] set info1 = '1001'

Update top (80) percent [log_info] set info2 = '1002'

Three Delete statements can also use the top keyword

Four Select sentences

1. With Ties

Execute the following sql:select top 5 * from testorder by id desc

The results are shown in the following figure:

Then execute the following sql to see the difference:

Select top 5 with ties * from testorder by id desc

You can see that when the current five records have not yet fully displayed the data of id = 2

Using with ties, you can display all the records with id = 2.

To be continued。 $identity, $RowGuid,Write clause

The above is how to add, delete, modify and search operations in sqlserver. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report