读书人

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

发布时间: 2012-09-05 15:19:34 作者: rapoo

如何用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;

读书人网 >SQL Server

热点推荐