In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Summary of sql statements for bulk insert data in MS SQL Server database:
The first kind:
Insert into tb_NameList (Name,InsertDate,UpdateDate)
Values ('aa',GETDATE (), GETDATE ())
Insert into tb_NameList (Name,InsertDate,UpdateDate)
Values ('bb',GETDATE (), GETDATE ())
Insert into tb_NameList (Name,InsertDate,UpdateDate)
Values ('cc',GETDATE (), GETDATE ())
In this way, all the statements are written and executed at once, which is actually the same as a single insert.
The second kind:
Insert into tb_NameList (Name,InsertDate,UpdateDate)
Values ('aa',GETDATE (), GETDATE ()), (' bb',GETDATE (), GETDATE ())
('cc',GETDATE (), GETDATE ())
This can write a lot less SQL statements, as long as the order of the Values is written clearly on OK.
The third kind:
Insert into tb_NameList (Name,InsertDate,UpdateDate)
Select 'dd',GETDATE (), GETDATE () union all
Select 'ee',GETDATE (), GETDATE () union all
Select 'ff',GETDATE (), GETDATE ()
With the help of union all, it is said to be faster than the second one, but the field is simple and the effect is not obvious with less data.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.