简体   繁体   English

当使用 .NET (C#) 的 SQL API 时,我应该输出什么作为文件的扩展名?

[英]When using SQL API's for .NET (C#), what should I out as the file's extension?

I'm using the binaries from Microsoft.SqlServer.Management.Common, Microsoft.SqlServer.Management.Smo我正在使用 Microsoft.SqlServer.Management.Common、Microsoft.SqlServer.Management.Smo 的二进制文件

The code is:代码是:

bkup.Devices.AddDevice(dbName, DeviceType.File);

bkup.CompressionOption = BackupCompressionOptions.On;

The extensions for the compressed.bak files are not there... is it.rar, .zip, etc, etc?没有压缩过的.bak 文件的扩展名...是it.rar、.zip 等吗?

My program successfully backups up the dbs, but people are annoyed that there are no file extensions.我的程序成功备份了 dbs,但人们对没有文件扩展名感到恼火。 The documentation for this API, says nothing about an extension when using BackupCompressions.On此 API 的文档没有说明使用BackupCompressions.On时的扩展

Does anyone know?有人知道吗? (sources appreciated) (来源赞赏)

I use '.bak' exstension for compressed backups.我使用“.bak”扩展名进行压缩备份。 Maybe I'm wrong, but I cannot see why the extesion should be changed if backup is compressed.也许我错了,但我看不出为什么压缩备份时应该更改扩展。

SQL Server compresses data as it performs the backup. SQL 服务器在执行备份时压缩数据。 It does not first create a backup file and the compresses it using zip or rar, so you cannot use a tool such as zip or rar to un-compress the backup file.它不会先创建备份文件,而是使用 zip 或 rar 对其进行压缩,因此您不能使用 zip 或 rar 等工具来解压缩备份文件。 Compressed backup files only make sense to SQL Server itself.压缩的备份文件只对 SQL 服务器本身有意义。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该在哪些类中使用C#的using语句? - What classes should I use C#'s using statement with? 使用C#.NET从Amazon AWS S3云中获取文件名且没有扩展名的文件 - Getting file from Amazon AWS S3 cloud with file name without extension using C# .NET 在C#.Net中使用委托,当我用完.Net线程池中的线程时会发生什么? - Using delegates in C# .Net, what happens when I run out of threads in the .Net threadpool? 什么是VB.NET相当于C#的&#39;using&#39;块 - What is the VB.NET equivalent to C#'s 'using' block 我想在 c# 中创建一个新的文件扩展名,如“prproj”primiere pro,我该怎么办? - i wanna create a new file extension like "prproj"primiere pro in c# what should i do? 我如何使用JSON.net从c#中的JSON文件中获取密钥及其对象? - How do I get the key and it's object from a JSON file in c# using JSON.net? 使用 Stream 的 API 修改 C# 中的文件内容 - Modify a file content in C# using the Stream's API 使用C#将数据添加到Microsoft的SQL Server文件中 - Adding data to a Microsoft's SQL Server file using c# 我需要做些什么才能使用C#ASP .NET Web API发送Protobuf序列化数据? - What do I need to do to send out Protobuf serialized Data using C# ASP .NET web api? 如何覆盖 appsettings.json 或 appsettings。<envrionment> .json 文件以编程方式使用 .net 核心 web api 和 C#?</envrionment> - How to overrite appsettings.json or appsettings.<envrionment>.json file(s) programtically using .net core web api with C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM