--环境说明
/*
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64)
Jul 9 2008 14:17:44
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Evaluation Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
*/
if not exists(select * from sys.tables where name='test1' or name='test2')
create table test1
(col1 int,
col2 int);
go
create table test2
(col1 int,
col2 int);
--单行数据
insert into test1 values(2,4)
--08版专有
--多条记录集合插入
insert into test1
values(1,2),
(3,4);
--select语句插入
insert into test1
select 1,2 union all
select 3,4 ;
insert into test1
select * from test2 ;