Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Sql Server 2005 create a db from a backup

  • 25-03-2008 04:56PM
    #1
    Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭


    All I have is the .bak file, can this be used to create a new database? If so, how?


Comments

  • Closed Accounts Posts: 317 ✭✭tiptap




  • Registered Users, Registered Users 2 Posts: 981 ✭✭✭fasty


    There's probably a better way, but what I do is make a new blank database then follow the instructions linked by tiptap above. You might need to overwrite the existing database the first time at least.


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    tiptap wrote: »

    That's not what I want, I'm not restoring a database I'm creating one:

    http://msdn2.microsoft.com/en-us/library/ms186390.aspx


  • Registered Users, Registered Users 2 Posts: 68,173 ✭✭✭✭seamus


    Evil Phil wrote: »
    That's not what I want, I'm not restoring a database I'm creating one:

    http://msdn2.microsoft.com/en-us/library/ms186390.aspx
    That should do the job. If it's an entirely different server though, you'll need to check permissions and that - with the exception of dbo, the same users won't exist, which may screw with views and schemas.

    On SQL Server, you have to create the user to have server access and then you can link the server user to a database user. Database backups will create the database users, whether or not the corresponding server users exist.


  • Moderators, Society & Culture Moderators Posts: 9,688 Mod ✭✭✭✭stevenmu


    You've probably done this by now, but if not when restoring also go into the options and choose to restore over existing database and also check the file paths that it's going to use, IIRC it will try to restore to the same path/filename as the original DB and not the new one you created, which may or may not be ok in your case but worth checking first.


  • Advertisement
Advertisement
Advertisement