如何在 C# 中使用 smo 查找我的数据文件和日志文件的存储位置
谁能告诉我如何在 C# 中使用 SMO 查找数据和日志文件存储的位置?
Can anybody please tell me how to find the location where my data and log files stored using SMO in c#?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此示例假设您对 Server\Database 有足够的权限,并且仅返回文件组中第一个 db/log 文件的完整路径\文件名。
文件组、文件和日志文件是 SMO 集合,将包含一个或多个各自的项目。
This example assumes you have sufficient rights to the Server\Database, and only returns the full path\filename for the first db/log file in the filegroup.
FileGroups, Files, and LogFiles are SMO collections that will contain one or more of it's respective items.
显然,您可以“从文件组和文件集合中获取逻辑数据和日志文件的名称”。
请参阅链接文本
apparently you can "get the names of the logical data and log files from the FileGroups and the Files collections."
see link text
这应该会给你确切的路径。
That should get you the exact paths.