insert into 表1 select * from 表2

利用游标

delete saler
DECLARE @SalerID int
DECLARE @SalerName nvarchar(200)

DECLARE cursor1 cursor for
select
 [SalerID],
 [SalerName]
from [zmr817].[dbo].[Saler]

open cursor1
fetch next from cursor1 into
@SalerID,
@SalerName

while @@fetch_status=0
begin
insert into [newjcjq].[dbo].[Saler](
[SalerID],
[SalerName]
)
values(
@SalerID,
@SalerName)


fetch next from cursor1 into
@SalerID,
@SalerName

end

close cursor1                  
deallocate cursor1

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-11-19
  • 2021-11-02
  • 2021-06-08
  • 2021-12-06
猜你喜欢
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-11-28
相关资源
相似解决方案