Did not know that...

by Jim May 15, 2008 4:07 PM

I just found out that it's possible to restore a database that doesn't exist. That is, create a database directly from a backup. I randomly found that this can be done from the command line, so I looked for it in SQL Server Management Studio. Right click on Databases in the Object Explorer and choose "Restore Database..." Now type the name of the database to create, then choose the backup file.

The great thing about this it determines from the backup which data files it needs to create, so if these are non-standard you don't have to worry about it.

All this time I've been creating a blank database and restoring over it. :-(

Tags:

Add comment


(Shows Gravatar icon; will not be displayed)

  Country flag
Click to change captcha
biuquote
  • Comment
  • Preview
Loading