I need to retrieve latest backup dates, looping thru a list of linked servers.
This is the code:
;with backup_cte as
when 'D' then 'database'
when 'L' then 'log'
when 'I' then 'differential'
partition by database_name, type
order by backup_finish_date desc
where rownum = 1 AND database_name NOT IN ('model')
order by database_name;
The Server name being returned is the name of the local server the statement is running on. I want the name of the server I'm retrieving backup info for.
Can this be done? Thanks!