我想通過powershell腳本來連接mssql資料庫,執行以下命令,得出一個值,如果值大于50則輸出1,小于50輸出0,使用Powershell腳本執行此操作
急用,請大佬幫忙,加Q可發紅包,1564837491
下面是陳述句,
declare @totalNo int
declare @currentNo int
declare @rate decimal
select @totalNo=count(*) from [LD2017lc].[dbo].[Computer]
--select @totalNo
select @currentNo=count(*) from [LD2017lc].[dbo].[Computer] where datediff(hh ,lastupdinvsvr,getdate()) <=24
--select @currentNo
set @rate=cast(@currentNo*100.0/ @totalNo as int)
select @rate
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/268828.html
標籤:其他數據庫
