SqlServer批量insert多条语句

2023-02-21 00:00:00 专区 订阅 付费 交易 评论

1、
INSERT INTO MyTable(ID,NAME) VALUES(1,‘123’);
INSERT INTO MyTable(ID,NAME) VALUES(2,‘456’);
INSERT INTO MyTable(ID,NAME) VALUES(3,‘789’);

2、
INSERT INTO MyTable(ID,NAME)
SELECT 4,‘000’
UNION ALL
SELECT 5,‘001’
UNION ALL
SELECT 6,‘002’

3、
insert into persons
(id,lastname,firstName,city)
values
(200,‘haha’,‘deng’,‘shenzhen’),
(201,‘haha1’,‘deng’,‘chongqing’),
(202,‘haha2’,‘deng’,‘chengdu’),
(203,‘haha3’,‘deng’,‘shenzhen’),
(204,‘haha4’,‘deng’,‘chongqing’),
(205,‘haha5’,‘deng’,‘chengdu’)



本文来源https://www.modb.pro/db/25255

相关文章