Articles by "msdb"

Showing posts with label msdb. Show all posts

 we can use below script to get last database name and date by executing below script

SELECT bus.database_name Org_DBName,
       restored_to_dbname,
       last_date_restored
FROM   msdb..backupset bus
       INNER JOIN (SELECT backup_set_id,
                          restored_to_dbname,
                          last_date_restored
                   FROM   msdb..restorehistory
                          INNER JOIN (SELECT rh.destination_database_name
                                             Restored_To_DBName,
                                             Max(rh.restore_date)
                                             Last_Date_Restored
                                      FROM   msdb..restorehistory rh
                                      GROUP  BY rh.destination_database_name) AS
                                     InnerRest
                                  ON destination_database_name =
                                     restored_to_dbname
                                     AND restore_date = last_date_restored) AS
                  RestData
               ON bus.backup_set_id = RestData.backup_set_id 


We can use below simple script to get an information about which SSIS package is belongs to which SQL job.


use msdb
go
select * from sysjobsteps where command like '%package name text here%'
go
select * from sysjobs  where job_id='give job id of above script out put'


SSIS information in MSDB database












we will need to collect the information about the sysjobsteps which is availble in the MSDB database after that we need to collect the job id and than the same can be used in the sysjobs so that we will get results of which SSIS package is belongs to which SQL job.

Author Name

Contact Form

Name

Email *

Message *

Powered by Blogger.