1. 程式人生 > >SQL Server 2012資料庫備份與還原

SQL Server 2012資料庫備份與還原

備份為.bak檔案

  1. 選中資料庫---->右鍵---->任務---->備份

https://img-blog.csdnimg.cn/20181220085600879

https://img-blog.csdnimg.cn/20181220085600925

https://img-blog.csdnimg.cn/20181220085600948

還原.bak檔案

  1. 說明:不要新建資料庫,直接還原
  2. 資料庫---->右鍵---->還原資料庫

https://img-blog.csdnimg.cn/20181220085600967

  1. 源---->裝置---->選中

https://img-blog.csdnimg.cn/2018122008560152

https://img-blog.csdnimg.cn/2018122008560172

備份為.sql檔案

  1. 選中資料庫---->右鍵---->任務---->生成指令碼

https://img-blog.csdnimg.cn/20181220085601146

https://img-blog.csdnimg.cn/20181220085601258

https://img-blog.csdnimg.cn/20181220085601280

  1. 修改一下匯出的.sql檔名字

https://img-blog.csdnimg.cn/20181220085601296

  1. 匯出型別:高階---->架構和資料(預設是架構沒有資料)

https://img-blog.csdnimg.cn/20181220085601319

https://img-blog.csdnimg.cn/20181220085601338

 

還原.sql檔案

  1. 說明:不要新建資料庫,直接還原
  2. 檔案---->開啟---->備份的.sql檔案

 

  1. 右側出現開啟的sql語句指令碼---->執行