I'm querying 'sessions' playback data using the SpotlightStatisticsRepository..spotlight_rt_get_batch_data stored procedure as follows
@start_date = '2021-05-10',
@end_date = '2021-05-11',
@monitoredobject_list = N'xxxxxxxx_sqlserver'
This works great with the exception that the sql statement associated with each spid isn't available as an output column.
You can see the SQL statement for each spid in the Spotlight app by rolling back to the time you are interested in and clicking on the spid in 'Session details' , however this is a long winded process if you are looking for a specific SQL statement.
Does anyone know of a way to extract historical SQL statements ?