我本地的SQLinsert into TempTable(id,name)
values(4,'a'),
(5,'b'),
(6,'b'),
(7,'b'),
(8,'b')没问题,能插入成功服务器上的SQLinsert into TempTable(id,name)
values(4,'a'),
(5,'b'),
(6,'b'),
(7,'b'),
(8,'b')语法错误,错误具体如下:
消息 170,级别 15,状态 1,第 2 行
第 2 行: ',' 附近有语法错误。不知为什么,所有的sql语句都是在英文输入法下写的。
values(4,'a'),
(5,'b'),
(6,'b'),
(7,'b'),
(8,'b')没问题,能插入成功服务器上的SQLinsert into TempTable(id,name)
values(4,'a'),
(5,'b'),
(6,'b'),
(7,'b'),
(8,'b')语法错误,错误具体如下:
消息 170,级别 15,状态 1,第 2 行
第 2 行: ',' 附近有语法错误。不知为什么,所有的sql语句都是在英文输入法下写的。
select 4,'a' union all
select 5,'b' union all
select 6,'b' union all
select 7,'b' union all
select 8,'b'
select 4,'a'
union
select 5,'b'
union
select 6,'b'
union
select 7,'b'
union
select 8,'b'
insert into temptable(id,name) select 1,'a'insert 多行
insert into temptable(id,name)
select 1,'a' union all
select 2,'b' union all
select 3 ,'c'
学习insert into TempTable(id,name)
SELECT 4,'a' UNION ALL
SELECT 5,'b')UNION ALL
SELECT 6,'b'UNION ALL
SELECT 7,'b'UNION ALL
SELECT 8,'b'
用UNION 连在一起插入
(
id int,
name varchar(20)
)insert into TempTable(id,name)
values(4,'a'),
(5,'b'),
(6,'b'),
(7,'b'),
(8,'b')
drop table temptable
经测试 2008 是可以的
05 是不行的 只能用union all
select 4,'a' union all
select 5,'b' union all
select 6,'b' union all
select 7,'b' union all
select 8,'b'