create proc sp_test asinsert into t2(id,title,content) select id,title,content from t1 where w='1' go --执行 exec sp_test
--1.表t2(id,title,content) 中ID不是自增量: create proc T_proc as insert t2 select * from t1 where w='1' --2.表t2(id,title,content) 中ID不是自增量: create proc T_proc as insert t2 select title,content from t1 where w='1'
--上面第2条描述写返了 --1.表t2(id,title,content) 中ID不是自增量: create proc T_proc as insert t2 select * from t1 where w='1' --2.表t2(id,title,content) 中ID是自增量: create proc T_proc as insert t2 select title,content from t1 where w='1'
asinsert into t2(id,title,content)
select id,title,content
from t1
where w='1'
go
--执行
exec sp_test
create proc T_proc
as
insert t2 select * from t1 where w='1'
--2.表t2(id,title,content) 中ID不是自增量:
create proc T_proc
as
insert t2 select title,content from t1 where w='1'
--1.表t2(id,title,content) 中ID不是自增量:
create proc T_proc
as
insert t2 select * from t1 where w='1'
--2.表t2(id,title,content) 中ID是自增量:
create proc T_proc
as
insert t2 select title,content from t1 where w='1'
用不用什么循环控制语句或什么指针下移等技术呢?