Skip to content

Instantly share code, notes, and snippets.

@RahulSharma
Created May 27, 2020 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RahulSharma/51c12eea46dd552975a722193eb97165 to your computer and use it in GitHub Desktop.
Save RahulSharma/51c12eea46dd552975a722193eb97165 to your computer and use it in GitHub Desktop.
Create a copy of sql db
BACKUP DATABASE [AxDB] TO DISK = N'D:\Backups\axdb_golden.bak' WITH NOFORMAT, NOINIT, NAME = N'AxDB_golden-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO
RESTORE DATABASE [AxDB_CopyForExport] FROM DISK = N'D:\Backups\axdb_golden.bak' WITH FILE = 1,
MOVE N'AXDBBuild_Data' TO N'F:\MSSQL_DATA\AxDB_CopyForExport.mdf',
MOVE N'AXDBBuild_Log' TO N'G:\MSSQL_LOGS\AxDB_CopyForExport_Log.ldf',
NOUNLOAD, STATS = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment