cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

SQL Server - Multiple Results return only one row

So, I'm using a sql statement that works fine, but should return multiple rows, instead it returns the one in the top, is there any way I can return all the rows? My statement for the record:

select 'ID', TransactionId
FROM [dbo].[TransactionStatus]
where StatusId = '5'
and ValidFrom>'2020-02-27'

0 Kudos
1 Reply

Where are you using this query? If it is inside a custom alert variable then that is working as intended, those are supposed to pull back a single cell of data. There is a trick with custom sql and a command called for xml path where SQL can take a whole table of data and the SW engine will interpret it as a single cell, so thats what I use when I want to dump a table into an email. I actually posted an example using that today here, https://thwack.solarwinds.com/t5/SAM-Discussions/Easy-method-to-include-a-list-of-monitored-process-...
- Marc Netterfield, Github
0 Kudos