zoukankan      html  css  js  c++  java
  • mssql获取excel进程数量的sql

    if object_id('tempdb..excel') is not null drop table tempdb..excel
    create table tempdb..excel
    (outstr varchar(500))

    insert into tempdb..excel
    exec master..xp_cmdshell 'TASKLIST /FI "Imagename eq excel.exe"'

    select case when count(*)>=5
    then  '目前'+cast(count(*)-4 as varchar(20))+'个excel进程'  else '无进程'  end
    from tempdb..excel

    注意有些电脑上无法执行tasklist ,默认在system32目录下tasklist.exe这个文件,复制过去就可以

    显示这个是因为system32下没有tasklist.exe这个外部命令,你可以从其他机器或网络上下载放到system32下。
    如果你在system32下可以找到tasklist.exe,那就是系统环境变量有问题,
    你可以在我的电脑-属性-高级-环境变量中 设置path值 添加c:\windows\system32。
     
  • 相关阅读:
    转码解码问题
    时间问题
    弹框
    获取地址栏参数
    vue返回上一页面如果没有上一页面返回首页
    html知识点
    传统的事件类型
    vue的指令
    事件取消
    事件处理程序
  • 原文地址:https://www.cnblogs.com/cwfsoft/p/1923417.html
Copyright © 2011-2022 走看看