PSSqlUpdater icon indicating copy to clipboard operation
PSSqlUpdater copied to clipboard

Multiple records returning

Open KezHalls opened this issue 7 years ago • 2 comments

Hi I cannot figure out what is going on.... if I don't explicitly return 1 record it fails

So I have to change $currentVersion = ConvertTo-VersionObject -Version $sqlInstance.Version to $currentVersion = ConvertTo-VersionObject -Version $sqlInstance.Version[0]

I tried this script on 3 different editions and 2 different versions and I can confirm I am getting multiple records on the first 2.... below is what it returns (the first 2 attempts return 2 records... the last just the one record... which will then work. They all have similar components installed as well.

@{ComputerName=xxxxxx; InstanceType=Database Engine; InstanceName=MSSQLSERVER; InstanceID=MSSQL11.MSSQLSERVER; InstanceDir=E:\MSSQL; Edition=Enterprise Edition; Version=11.2.5058.0; Caption=SQL S erver 2012; IsCluster=False; IsClusterNode=False; ClusterName=; ClusterNodes=System.Object[]; FullName=xxxxxx} @{ComputerName=xxxxxx; InstanceType=Analysis Services; InstanceName=MSSQLSERVER; InstanceID=MSAS11.MSSQLSERVER; InstanceDir=E:\MSSQL; Edition=Enterprise Edition; Version=11.2.5058.0; Caption=SQL Server 2012; IsCluster=False; IsClusterNode=False; ClusterName=; ClusterNodes=System.Object[]; FullName=xxxxx}

@{ComputerName=yyyyyy; InstanceType=Database Engine; InstanceName=yinstance; InstanceID=MSSQL12.yinstance; InstanceDir=d:\Program Files\Microsoft SQL Server; Edition=Developer Edition; Ve rsion=12.2.5522.0; Caption=Unknown; IsCluster=False; IsClusterNode=False; ClusterName=; ClusterNodes=System.Object[]; FullName=yyyyyy\yinstance} @{ComputerName=yyyyyy; InstanceType=Reporting Services; InstanceName=yinstance; InstanceID=MSRS12.yinstance; InstanceDir=D:\Program Files\Microsoft SQL Server; Edition=Developer Edition; Version=12.2.5522.0; Caption=Unknown; IsCluster=False; IsClusterNode=False; ClusterName=; ClusterNodes=System.Object[]; FullName=yyyyyy\yinstance}

@{ComputerName=zzzzz; InstanceType=Database Engine; InstanceName=zinstance; InstanceID=MSSQL12.zinstance; InstanceDir=d:\Program Files\Microsoft SQL Server; Edition=Standard Edition; Ver sion=12.2.5522.0; Caption=Unknown; IsCluster=False; IsClusterNode=False; ClusterName=; ClusterNodes=System.Object[]; FullName=zzzzz\zinstance}

Thanks Kez

KezHalls avatar Jun 06 '17 03:06 KezHalls

@KezHalls Can you show me the output of this?

Get-SqlInstance -ComputerName <YourSqlServer>

I don't have support in for multiple instances. I need to add that.

adbertram avatar Jun 06 '17 14:06 adbertram

That makes sense for the first server which I just realised has a second SSRS instance on it. But not for this one. Which just has 2 base components. See attached yInstance.txt

KezHalls avatar Jun 07 '17 03:06 KezHalls