Skip to content

Instantly share code, notes, and snippets.

@niisar
Last active August 29, 2015 14:06
Show Gist options
  • Save niisar/c38944e742e8f761a844 to your computer and use it in GitHub Desktop.
Save niisar/c38944e742e8f761a844 to your computer and use it in GitHub Desktop.
db backup restore
-------------------sqlserver
--detach db
EXEC master.dbo.sp_detach_db @dbname = N'nopCommerce'
--restore db
RESTORE DATABASE [nopCommerce] FROM
DISK = N'F:\NISAR WORKSPACE\E-Logistics\DB-E-Logistics\eLogistics.bak'
WITH REPLACE
GO
--backup db
BACKUP DATABASE [eLogistics] TO
DISK = N'F:\NISAR WORKSPACE\E-Logistics\DB-E-Logistics\eLogistics.bak'
WITH NOFORMAT
go
-- format / noformat ► If you use FORMAT any existing contents get erased. / If you use NOFORMAT (the default) you can write multiple backups to the same file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment