您的位置:首页 > 数据库

从一个数据库导入另一个数据库

2009-12-31 15:55 225 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: