How sql statements add data in batches
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.