当前位置: 代码迷 >> Sql Server >> 怎么用SQL语句向一个表中插入多行记录
  详细解决方案

怎么用SQL语句向一个表中插入多行记录

热度:32   发布时间:2016-04-27 11:22:09.0
如何用SQL语句向一个表中插入多行记录
帮个忙、

------解决方案--------------------
SQL code
insert into yourtable (col1)select 1union all select 2union all select 3;
------解决方案--------------------
SQL code
--1:insert into table(col)select 1 union all select 2 union all select 3;--2:insert into table (col)slect 1 go 100/*执行100次*/--3:select * into tableb /*批量插入新表*/ from tablea
------解决方案--------------------
SQL code
--tryinsert into table(col)select 1 union all select 2 union all select 3;
------解决方案--------------------
探讨
SQL code


--1:
insert into table(col)
select 1 union all
select 2 union all
select 3;

--2:
insert into table (col)
slect 1
go 100/*执行100次*/

--3:
select * into tableb /*批量插入新表*/ fr……

------解决方案--------------------
探讨

SQL code

insert into yourtable (col1)
select 1
union all select 2
union all select 3;
  相关解决方案