Copying one database to another

  • HI,

    How can I tell when the last copy of one database was made to another database. The CREATE DATES of the tables do not reflect when the last time the data was last copied over. and the DATE CREATED on the taskpad view of the database doesn't reflect the most recent import of the database.

    Thanks,

    Juanita

     

  • I assume you're talking about copying using DTS or truncate/insert, so tables aren't dropped and recreated.  If that's the case, the only way I know of finding when data was replaced is to have Profiler auditing the database constantly.  Perhaps you could also use a log reader tool to scan the tlogs looking for truncates and inserts.

    Greg

    Greg

  • Greg,

    Thank you. Those are good ideas. I'll look at the log.

    Juanita

     

  • If you created the db with restore database command... you can check the last backup inforamtion info in task pad...or by running the query in msdb...

    select top 1 * from msdb..backupset

    where database_name = 'db name'

    order by backup_finish_date desc

    select top 1 * from msdb..restorehistory

    where destination_database_name = 'db name'

     

    If you created the db by attaching the files using the sp_attachdb then check the mdf and ldf files created date.

     

     

    MohammedU
    Microsoft SQL Server MVP

  • Great idea!!!

    thanks,

    Juanita

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply