I have this SQL query
SELECT a.name, a.state_desc, b.start_date, b.modify_date, b.percentage_complete
FROM sys.databases AS a
INNER JOIN sys.dm_database_copies AS b ON a.database_id = b.database_id
WHERE a.state = 7;
I want to extract the table name from the query which in this case is the databases
How can I do it? I am mostly concerned with fetching the database table name immediately after the From
clause, any guidance how can I do it?