SQL script to “copy” a database

后端 未结 7 606
名媛妹妹
名媛妹妹 2020-12-14 20:46

I want to write a SQL script that will copy a database on the same server. I could do a backup/restore, but I think it might be faster to just \"copy\" somehow. Does anyon

7条回答
  •  隐瞒了意图╮
    2020-12-14 21:23

    CREATE DATABASE mydatabase_copy AS COPY OF mydatabase;
    

    This will work on an AZURE Database, and will achieve the same end result. Two attached databases - the original and the copied one.

提交回复
热议问题