SQL 备份到 ADO.NET 的独立存储

发布于 2024-09-29 00:45:04 字数 73 浏览 0 评论 0原文

是否可以使用 C# ADO.net 创建 SQL Server 数据库备份并将 .BAK 文件输出到独立存储?

谢谢

Is it possible to create an SQL server database backup using c# ADO.net and outputting the .BAK file to Isolated storage?

Thanks

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

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

发布评论

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

评论(2

奢望 2024-10-06 00:45:04

您指的是哪种独立存储?

怎么样:

  • 创建一个存储过程来执行备份。

    备份数据库 [Foo]
    TO DISK = N'\\server\directory\Foo.BAK' 带有 NOFORMAT、NOINIT、
    名称 = N'Foo-FullBackup'、跳过、NOREWIND、NOUNLOAD、统计 = 10
    GO

  • 从 C# 客户端代码在 SQL Server 上调用此存储过程

  • 根据您的需要(隔离存储?)使用 System.IO.File.Move() 将 .BAK 文件从源移动到目的地。

What kind of isolated storage are you referencing?

How about:

  • create a stored proc to perform the backup.

    BACKUP DATABASE [Foo]
    TO DISK = N'\\server\directory\Foo.BAK' WITH NOFORMAT, NOINIT,
    NAME = N'Foo-FullBackup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO

  • call this stored proc on the SQL Server from your C# client code

  • depending on your needs (isolated storage?) use System.IO.File.Move() to move the .BAK file from its source to your destination.

久而酒知 2024-10-06 00:45:04

不能。因为无法通过程序访问隔离存储 PATH,所以您无法告诉 SQL Server 将内容放在那里。

此外,对于除了最琐碎的应用程序之外的任何应用程序,与数据库备份所需的大小相比,独立存储的大小限制将是一个笑话。

No. Because there is no way to get access to the isolated storage PATH by program, you can not tell SQL Server to put things there.

Also, for anything but the most trivial applications, the size limit on isolated storage would be a joke compared what you need for a db backup.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文