使用SQL语句进行批量插入演示数据

方法1:逐条执行,速度慢

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

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

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

方法2:批量执行,适用于 SQL Server

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

方法3:批量执行,适用于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 1
FROM DUAL;
数据库开发

SQL查询表中某列字符指定长度的所有信息

2021-11-15 14:40:46

数据库开发

SQLServer数据表字典生成语句(直接运行)

2021-11-15 14:56:40

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索