Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Trying to copy a SQL server 2005 database

Trying to copy a SQL server 2005 database

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelpquestion
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jane Williams
    wrote on last edited by
    #1

    We have a database on a SQL 2005 server. We'd like to take an exact copy of it, on the same server (yes, I know this isn't the ideal place for a true dev system), giving the result a name such as mydbname_dev, so as to use it for test purposes. When I right-click on the database, I see under Tasks an option called "Copy database", which sounds perfect. Only, it doesn't work. Examination of log files tells me that "The login already has an account under a different user name." OK. More Googling suggests that I need to "remove the default associated objects transfer for LOGINS". This means using the "Select Database Objects" screen. Which I can't find... and further investigation shows that it doesn't appear if you're copying to the same server. Is it really impossible to use "copy database" to simply copy a database? Any suggestions as to a better way of going about this? I want the new copy to be identical in every way except name to the production database, so we can use it to test out some scripts before we run them on the real thing, and I'd like the copy method to be as simple as possible, to avoid the chances of me introducing an error by typo, or by omitting some vital step.

    L 1 Reply Last reply
    0
    • J Jane Williams

      We have a database on a SQL 2005 server. We'd like to take an exact copy of it, on the same server (yes, I know this isn't the ideal place for a true dev system), giving the result a name such as mydbname_dev, so as to use it for test purposes. When I right-click on the database, I see under Tasks an option called "Copy database", which sounds perfect. Only, it doesn't work. Examination of log files tells me that "The login already has an account under a different user name." OK. More Googling suggests that I need to "remove the default associated objects transfer for LOGINS". This means using the "Select Database Objects" screen. Which I can't find... and further investigation shows that it doesn't appear if you're copying to the same server. Is it really impossible to use "copy database" to simply copy a database? Any suggestions as to a better way of going about this? I want the new copy to be identical in every way except name to the production database, so we can use it to test out some scripts before we run them on the real thing, and I'd like the copy method to be as simple as possible, to avoid the chances of me introducing an error by typo, or by omitting some vital step.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Make a backup, and restore it under a new name :)

      J 1 Reply Last reply
      0
      • L Lost User

        Make a backup, and restore it under a new name :)

        J Offline
        J Offline
        Jane Williams
        wrote on last edited by
        #3

        And that'll preserve all my access control and so on? OK, thanks - will do.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups