Attach to existing database?

  • We are moving Vendor's database to a new SQL cluster server.

    It's Sophos Antivirus software.

    Support team gave us instructions with scripts.

    Step one is we have to run Installer that creates database, procedures, security role, logins, users on SQL Server.

    In step two....

    They say "ATTACH the database and it will populate data in the database created in the previous step..."

    Will it work?

    I thought you cannot attach database if it already exists?....

  • You cannot. What they probably mean is that you attach their database and run somee script(possibly a part of the vendor's install process), which will migrate the data from their database to your newly created one.

  • looks like poorly worded documentation to me.

    the way i read that is that they mean this instead:

    ATTACH the database connect the application to that database and it the application will populate data in the database created in the previous step...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Guys,

    So how exactly ATTACH works?

    It creates a new database from MDF,LDF files?

    With stored porcedures, Users, Roles - everything?

  • RVO (12/6/2012)


    So how exactly ATTACH works?

    see this http://msdn.microsoft.com/en-us/library/ms190794(v=sql.90).aspx

    RVO (12/6/2012)


    It creates a new database from MDF,LDF files?

    NO

    RVO (12/6/2012)


    With stored porcedures, Users, Roles - everything?

    Yes , but it will make the users ORPHAN , if you are attaching it on different database server. now google "orphan user" 😀

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply