将记录从一个数据库复制到另一个数据库

编程入门 行业动态 更新时间:2024-10-23 13:33:51
本文介绍了将记录从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

更多推荐

将记录从一个数据库复制到另一个数据库

本文发布于:2023-10-16 16:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498145.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!