need to delete the datbase and then restore of the different backup on daily bases

  • Good Morning I would appreciate if I can get a syntax to run, this is what I need to accomplish,

    Delete the database, (it gives me error with connections open)

    Once it is deleted I want to restore it of .bak file,

    Help is much appreciated,

    Regards,

    Bubby

  • Why are you deleting the database before restoring it?

    You can restore with replace, which will overwrite the entire database

  • Can I get the syntax for that, it makes sense

  • restore database [db_name] from disk = 'location\.bak' with replace

  • Please do not worry, thanks anyways, I did the task as below,

    RESTORE DATABASE XYZ FROM DISK = 'C:\XYZ.BAK'

    WITH REPLACE

    GO

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

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