Get the App
SLTechnology News&Howtos  ›  Database  › 

How sql statements add data in batches

Shulou Source: shulou.com Published: 2022-05-31 23:59:39 11月16日 Update

This article will explain in detail how to add data in batches of sql sentences. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

What is the method of adding data in batches in sql statements?

Method 1: execute one by one, the speed is slow.

INSERT INTO testimport (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'); INSERT INTO testimport (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'); INSERT INTO testimport (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd')

Method 2: batch execution, suitable for SQL Server.

INSERT INTO testimport (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'), ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'), ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd')

Method 3: batch execution, suitable for Oracle.

INSERT ALL INTO A (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd') INTO A (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd') INTO A (name, message) VALUES ('testname',' jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd') SELECT 1FROM DUAL This is the end of the article on "how to add data in batches with sql sentences". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Methods data statements articles more good practical content articles knowledge item by item speed reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno NVidia Huawei MariaDB