将记录从一个数据库复制到另一个数据库 [英] Copying Records from one database to another database

查看:70
本文介绍了将记录从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站托管上有两个数据库。但有些我需要将一些记录从数据库复制到另一个,在我的本地电脑上进行更多处理等我可以简单地查询它



I have two databases on an online website hosting. but some how i need to copy some of the records from on database to another, for more processing etc. on my local pc i could simplye query it as

insert into database2.schema.table
select * from database1.schema.table,





但在线服务器因安全问题而无法实现。我用Google搜索并找到了这些命令





but on online server that is not possible because of security issues. i googled and found these commands

exec sp_addlinkedserver @Server='myserver',
    @srvproduct    = '', @provider  = 'SQLNCLI', @catalog       = 'catalogname' ;
    EXEC sp_addlinkedsrvlogin @rmtsrvname='myserver',
        @useself='false',
        @rmtuser='username',
        @rmtpassword='password';





但我没有足够在线执行它的权限,所以 有没有其他方法从另一个数据库访问数据库?



PS:第二个数据库就像一个用于临时记录管理的IMAGE DATA TABLE,首先它在更改和计算后从第一个数据库复制记录等,它将把它写回第一个数据库,我的目标是编写可以选择的SQL程序/将记录从第一个数据库写入第二个数据库。



but i dont have enough permissions to execute it online, so is there any other way to access a database from another database?

PS: the second database is like an IMAGE DATA TABLE for temporary records management, first it copies records from first database after changes and work out etc, it will be writing it back to first database, My goal is to write SQL procedures which can select/write records from/to first database to second database.

推荐答案

我可以为您提供另一种解决方案:



1)备份您的在线数据库并在本地恢复。

2)在本地复制新数据库中的所需记录。

3)备份新的本地数据库并在线恢复。
i can get you another solution :

1)Backup your online database and restore it locally.
2)Copy the required records inside the new database locally.
3)Backup the new locally database and restore it online.


这篇关于将记录从一个数据库复制到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆