Article View: comp.misc
Article #180Re: SQL inside Windows OS?
From: Sylvia Else
Date: Sat, 14 Nov 2026 07:49
Date: Sat, 14 Nov 2026 07:49
36 lines
2504 bytes
2504 bytes
On 14-Nov-26 12:45 pm, JJ wrote: > On Sat, 14 Nov 2026 11:34:51 +0800, Sylvia Else wrote: >> This is a re-post, of sorts, since my previous attempt seems to have >> vanished into the void - something that Thunderbird occasionally does to me. >> >> I was using a command in Windows Powershell and got this error >> >> Get-NetTCPConnection: No matching MSFT_NetTCPConnection objects found by >> CIM query for instances of the ROOT/StandardCimv2/MSFT_NetTCPConnection >> class on the CIM server: SELECT * FROM MSFT_NetTCPConnection WHERE >> ((State = 2)) AND ((OwningProcess = 99310)). Verify query parameters and >> retry. >> >> This was an attempt to get the network ports on which a process is >> listening. >> >> And it's doing an SQL query to achieve that? Are you for real? >> >> Sylvia. > > The SQL query is for WMI objects in the case. WMI provides both native API > and WQL (WMI Query Language; SQL for WMI), but for lazy development reason, > PowerShell chose to use WQL instead of native API. PowerShell's built-in > commands may also use SQL for other components instead of using native APIs > if available. > > So, if you don't want PowerShell to use SQL, access WMI directly via its > native API from C# or VB.NET script. It'll be more work but it'd be slightly > faster and much more efficient - especially if what's needed must be > searched among all WMI objects and properties. OK, thanks. So it's not as bad as I thought. Wouldn't have surprised me, though. Sylvia.
Technical Details
Message-ID:
<nlqi4nF1csdU1@mid.individual.net>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<nlq36rFtn8pU1@mid.individual.net> <4q32vvya5o3m.t09tncbkygj9.dlg@40tude.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Sylvia Else <sylvia@email.invalid> Newsgroups: comp.misc Subject: Re: SQL inside Windows OS? Date: Sat, 14 Nov 2026 15:49:43 +0800 Lines: 36 Message-ID: <nlqi4nF1csdU1@mid.individual.net> References: <nlq36rFtn8pU1@mid.individual.net> <4q32vvya5o3m.t09tncbkygj9.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net AODiiqfyd9GWVXysQlBViQEdgSEWxa0Dlokfgmn4tzyJ/z9vI2 Cancel-Lock: sha1:7ifDncwh7DHuhFC2IS9A6YT8z5s= sha256:jvvVqSqkP6Zrq5Y51KrzWIOuMC+zPDzfG9uMrt09seo= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US In-Reply-To: <4q32vvya5o3m.t09tncbkygj9.dlg@40tude.net>