使用 LINQ to SQL 访问系统数据库/表?
- 作者: 只愿一生无悔付出
- 来源: 51数据库
- 2022-12-08
问题描述
现在我有一个 SSIS 包,它每天早上运行并给我一份关于前一天失败或成功的包数.这些包的信息部分包含在 SQL Server 2005.
Right now I have an SSIS package that runs every morning and gives me a report on the number of packages that failed or succeeded from the day before. The information for these packages is contained partly within the sysjobs table (a system table) within the msdb database (a system database) in SQL Server 2005.
当尝试将包移动到 C# 可执行文件时(主要是为了通过发送的电子邮件获得更好的格式),我无法找到一种方法来创建允许我通过以下方式访问这些表的 dbml 文件LINQ.我试图寻找可以使这些表可见的任何属性,但我运气不佳.
When trying to move the package to a C# executable (mostly to gain better formatting over the email that gets sent out), I wasn't able to find a way to create a dbml file that allowed me to access these tables through LINQ. I tried to look for any properties that would make these tables visible, but I haven't had much luck.
这是否可以使用 LINQ to SQL?
推荐答案
如果您在服务器资源管理器中,可以通过以下方式使它们可见:
If you're in Server Explorer, you can make them visible this way:
- 创建与所需服务器的连接.
- 右键单击服务器并选择更改视图">对象类型".
- 您现在应该会看到系统表和用户表.您应该会在那里看到 sysjobs,并且可以轻松地将其拖到 .dbml 表面上.
- C#通过fleck实现wss协议的WebSocket多人Web实时聊天(附源码)
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源
