Query table to get server list #9984
Unanswered
tbailey922X
asked this question in
Q&A
Replies: 1 comment
-
|
you query returns a "list of things" (rows), which for each element, contains a mapping between the column and the cell value. there are faster way to do that, but here the code is meant to show clearly how "plumbing" works. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Im sorry if Im asking in the wrong place, but I've looked everywhere and cannot find any help.
Im trying to query a sql table to get a list of servers and pass that server list into a command like below. It seems simple but i keep getting the error below. Any ideal what Im doing wrong?
$instances = Invoke-DbaQuery -SqlInstance "XXXX" -Database "dba" -Query "SELECT server +','+ CAST(port AS varchar)FROM servers"
Get-DbaDatabase -SqlInstance $instances
ERROR:
Get-DbaDatabase : Cannot process argument transformation on parameter 'SqlInstance'. Cannot convert value "System.Data.DataRow" to type "Dataplat.Dbatools.Parameter.DbaInstanceParameter[]". Error: "Cannot convert value "System.Data.DataRow" to type
"Dataplat.Dbatools.Parameter.DbaInstanceParameter". Error: "Failed to interpret input as Instance: System.Data.DataRow""
At line:2 char:30
Beta Was this translation helpful? Give feedback.
All reactions