I've write a select to create a report to get in one line per asset a concatenated result of a query, using the function STUFF.
It's fully working over SQL Management Studio.
In this case this Report should Create and Output of AssetID, AssetGroups all in one field.
138 Default group,File&Print,Nagios,Backup-HDLocal
149 Default group,Nagios,Backup-Cinta,Backup-Without-GRT
153 Default group,Citrix,Nagios,Serves-Without-Backup-allowed
This is the Select:
Select MAss.AssetID,
STUFF(
(
SELECT ','+ STAG.AssetGroup
FROM tblAssetGroupLink AS AGT
Inner Join tblAssetGroups as STAG On AGT.AssetGroupID = STAG.AssetGroupID
WHERE AGT.AssetID = MAss.AssetID
FOR XML PATH(''),TYPE)
.value('text()[1]','nvarchar(max)'),1,1,N'')
from tblAssetGroupLink AS MAss
Group by MAss.AssetID
Error "Invalid SELECT statement. Unexpected token "." at line 9, pos 3.: Unexpected token "." at line 9, column 3".
I'm running last version of Lansweeper.
Thanks in advance.
Best Regards.
Dani Garcia.