Is there any way to get windows task manager details through tsql?(有没有办法通过 tsql 获取 windows 任务管理器的详细信息?)
问题描述
我无法访问客户端的 Windows 远程机器,我只通过 tsql 连接他们的数据库服务器.我需要检查哪些进程占用更多内存并通知他们.是否有任何 tsql 查询来获取 windows 进程?
I do not have access to the client's windows remote machine,I connect their database server through tsql only.I need to check what processes taking more memory and inform them. Is there any tsql query to get windows processes?
推荐答案
是的,有可能.您可以通过 TASKLIST 命令调用 TASKLIST 命令msdn.microsoft.com/en-us/library/ms175046.aspx" rel="noreferrer">xp_cmdshell:
Yes, it is possible. You can call TASKLIST command via xp_cmdshell:
exec master..xp_cmdshell 'TASKLIST'
输出:
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 0 4 K
System 4 0 140 K
smss.exe 212 0 956 K
csrss.exe 332 0 5,560 K
.....
sqlservr.exe 1492 0 92,012 K
sqlservr.exe 1532 0 95,928 K
.....
注意:您应该拥有正确的权限和服务器配置选项来运行 xp_cmdshell.阅读 MSDN 中的备注部分以了解如何启用 xp_cmdshell
Note: you should have the correct permissions and Server configuration options to run xp_cmdshell. Read the remarks section in MSDN to understand how to enable xp_cmdshell
这篇关于有没有办法通过 tsql 获取 windows 任务管理器的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法通过 tsql 获取 windows 任务管理器的详细信息?


- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- SQL 临时表问题 2022-01-01