I am trying to update a record set with the last restore date that is captured with a TOP clause in the code.
Here is the code (that does not work):
Thanks!
Thanks
J. Kusch
Here is the code (that does not work):
Code:
UPDATE MyTable
SET MyDate =
( SELECT TOP 1 RESTORE_DATE
FROM MSDB.dbo.RESTOREHISTORY WITH (nolock)
JOIN MyTable
ON DESTINATION_DATABASE_NAME = DatabaseName )
FROM MyTable AS mt
INNER JOIN MSDB.dbo.RESTOREHISTORY
ON DESTINATION_DATABASE_NAME = mt.DatabaseName
Thanks!
Thanks
J. Kusch