使用 ASP.NET 备份 SQL Server

发布于 2024-08-28 10:32:18 字数 79 浏览 6 评论 0原文

我有 SQL Server 虚拟主机。我没有对 SQL Server 的物理访问权限。我想备份并下载。我怎样才能从asp.net页面做到这一点?

I have virtual hosting with SQL Server. I don't have physical access to SQL Server. I want to make backup and download it. How can I do it from asp.net page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

陌路终见情 2024-09-04 10:32:18

即使您没有对 mssql 的物理访问权限,您的托管提供商也可能有办法通过您的控制面板 GUI 来制作 mssql 备份并下载它。您可能想先咨询他们。

乔恩

Even if you do not have physical access to mssql your hosting provider may have a way through your control panel GUI to make a mssql backup and download it. You might want to check with them first.

Jon

丶情人眼里出诗心の 2024-09-04 10:32:18

我认为这里有些人正在采取心理捷径并建议您备份 SQL,就好像您具有对计算机的完全访问权限(您明确声明您没有)。

无法在托管环境上对 C:\Backup 或 C:\[anything] 进行标准备份。

您需要查看是否可以通过 SQL Server Management Studio 远程访问您的 SQL Server 实例(我使用过允许远程访问 SQL Server 端口的主机),然后,不要对 BAK 文件进行正常备份(意味着可以访问 SQL Server 中的本地硬盘),右键单击数据库并尝试从那里创建脚本。您将得到一个类似于 mysqldump 为 MySQL 创建的脚本的脚本。

如果失败,请查看您的控制面板,他们可能有一种工具也可以执行此操作,或者向您发送通过控制面板生成的 BAK 文件。

如果失败,请询问您的主人。

I think some people here are taking mental shortcuts and suggesting you backup the SQL as if you had full access to the machine (which you specifically state you do not have).

You will not be able to do a standard backup to C:\Backup or C:\[anything] on a hosted environment.

You need to see if you can remotely access your SQL Server instance through SQL Server Management Studio (I have used hosts that do allow remote access to the SQL Server port), and then, instead of doing a normal backup to a BAK file (which implies having access to a local hard drive in the SQL Server), right click on the database and try to create a script from there. You will get a script similar to the scripts that mysqldump creates for MySQL.

If that fails, then look into your control panel, they may have a tool that does that as well, or one that sends you a BAK file generated through the control panel.

Failing that, ask your host.

离不开的别离 2024-09-04 10:32:18

您可以像执行任何其他 SQL 查询或命令一样从 ASP.NET 发出 BACKUP 命令。

http://msdn.microsoft.com/en-us/library/ms186865。 aspx

  1. 为备份文件构造唯一的名称
  2. 连接到 SQL 并发出相关 BACKUP 命令
  3. 检查备份是否成功、备份文件是否存在并将其流回您的浏览器(使用 Response.TransmitFile)

You could issue the BACKUP commands from ASP.NET the same way as you would any other SQL query or command.

http://msdn.microsoft.com/en-us/library/ms186865.aspx

  1. Construct a unique name for the backup file
  2. Connect to SQL and issue the relevant BACKUP commands
  3. Check the backup was successful, the backup file exists and stream it back to your browser (using Response.TransmitFile)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文