April 1, 2015 at 2:07 pm
i want to query hyper-v with my sql server using sql query any idea plzz
thank you for help
April 1, 2015 at 2:44 pm
so you want to know if your SQL server is contained in a HyperV environment? is that the question?
i know @@version contains a string when it's in a VM: we use VMWare, i think, and my @@verison says this:
Microsoft SQL Server 2008 R2 (SP3) - 10.50.6000.34 (X64)
Aug 19 2014 12:21:34
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
Lowell
April 1, 2015 at 3:55 pm
I don't know of any way to query the hypervisor from within T-SQL. Not directly. Assuming the login your SQL Server instance operates under has permission to the hypervisor, it's possible to run queries against it from the PowerShell or the command prompt, but not using T-SQL.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 1, 2015 at 6:21 pm
thank you
so the question is :how can i export the data from hyper-v to my sql table (sql server ) using powershell
for exemple i want to export the result of get-vm (name,state,cpu usage....) into a table in my database
thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu for the help:-)
April 1, 2015 at 7:38 pm
I don't have specific scripts that I can supply you. However, the documentation is very clear. You can use the HyperV cmdlets to query the hypervisor. You can then use the SQL Server cmdlets to write to the database what you read from the hypervisor.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply