34,587
社区成员
发帖
与我相关
我的任务
分享
--> 测试数据:[Tbl1]
go
if object_id('[Tbl1]') is not null
drop table [Tbl1]
go
create table [Tbl1](
[id] int,
[Name] varchar(5)
)
go
insert [Tbl1]
select 1,'Name1' union all
select 2,'Name2'
go
create table tbl2(
[id] int,
[Name] varchar(5),
Test varchar(4)
)
insert tbl2
select *,Test='test' from Tbl1
select * from tbl2
/*
id Name Test
1 Name1 test
2 Name2 test
*/