import data problem in SQL server 2008

  • I want to import data from one database to another , the destination I don't have permission to resotre a backup file to it, so I have only one option which is to import data

    I used the withard, I set the option of allow identity insert but after run the transfer fail cause of foreign keys insertion, is there anything I miss or shall I drop the foreign keys and recreate it after import

    am really wonder why microsoft made it complicated

  • ali.mahmoud.habib (7/22/2012)


    I want to import data from one database to another , the destination I don't have permission to resotre a backup file to it, so I have only one option which is to import data

    Restoring a backup would be much more than importing data, isn't it?

    If you really need to replace the whole database either get the permissions or work with the DBA that has the permissions - it has to be a reason why you do not have the privileges to do it.

    ali.mahmoud.habib (7/22/2012)


    I used the withard, I set the option of allow identity insert but after run the transfer fail cause of foreign keys insertion, is there anything I miss or shall I drop the foreign keys and recreate it after import

    Yes. You are missing Referential Integrity.

    ali.mahmoud.habib (7/22/2012)


    am really wonder why microsoft made it complicated

    Microsoft is not making it complicated, you do not have privileges to do it the proper way and you are ignoring Referential Integrity when trying to work around the privileges issues so... who is making it complicated?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • PaulB-TheOneAndOnly (7/22/2012)


    ali.mahmoud.habib (7/22/2012)


    I want to import data from one database to another , the destination I don't have permission to resotre a backup file to it, so I have only one option which is to import data

    Restoring a backup would be much more than importing data, isn't it?

    If you really need to replace the whole database either get the permissions or work with the DBA that has the permissions - it has to be a reason why you do not have the privileges to do it.

    ali.mahmoud.habib (7/22/2012)


    I used the withard, I set the option of allow identity insert but after run the transfer fail cause of foreign keys insertion, is there anything I miss or shall I drop the foreign keys and recreate it after import

    Yes. You are missing Referential Integrity.

    ali.mahmoud.habib (7/22/2012)


    am really wonder why microsoft made it complicated

    Microsoft is not making it complicated, you do not have privileges to do it the proper way and you are ignoring Referential Integrity when trying to work around the privileges issues so... who is making it complicated?

    how to add Referential Integrity to import data I didn't find this option even manage map , also the erestriction because the database on godady

  • Do not use export/import wizard, script your data load - first do your parent tables then your child tables as defined by Referential Integrity constraints.

    An alternative would be to disable Referential Integrity - import the data then enable Referential Integrity constraints.

    In regards to hosting your database in an external facility - if you own the database you should have privileges to backup/restore, if hosting facility does not alows for it then you are hosting in the wrong place.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • PaulB-TheOneAndOnly (7/23/2012)


    Do not use export/import wizard, script your data load - first do your parent tables then your child tables as defined by Referential Integrity constraints.

    An alternative would be to disable Referential Integrity - import the data then enable Referential Integrity constraints.

    In regards to hosting your database in an external facility - if you own the database you should have privileges to backup/restore, if hosting facility does not alows for it then you are hosting in the wrong place.

    ok how to disable Referential Integrity

  • ali.mahmoud.habib (7/23/2012)


    PaulB-TheOneAndOnly (7/23/2012)


    Do not use export/import wizard, script your data load - first do your parent tables then your child tables as defined by Referential Integrity constraints.

    An alternative would be to disable Referential Integrity - import the data then enable Referential Integrity constraints.

    In regards to hosting your database in an external facility - if you own the database you should have privileges to backup/restore, if hosting facility does not alows for it then you are hosting in the wrong place.

    ok how to disable Referential Integrity

    My first question is why do you want to disable Referential Integrity?

    What you are asking to do is usually considered A Very Bad Thing (yes, I capitalized those words on purpose). At my workplace, anyone who disables RI gets put on the naughty list for the first offense and gets verbally flogged for the second offense. I won't go into what happens on the third offense.

    Next question(s). We've established that you don't have restore permissions. So what exactly is your position in the company? Are you a DBA or a Dev?

    If you're not a DBA, have you contacted the DBA for assistance in getting the data you need?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin (7/23/2012)


    ali.mahmoud.habib (7/23/2012)


    PaulB-TheOneAndOnly (7/23/2012)


    Do not use export/import wizard, script your data load - first do your parent tables then your child tables as defined by Referential Integrity constraints.

    An alternative would be to disable Referential Integrity - import the data then enable Referential Integrity constraints.

    In regards to hosting your database in an external facility - if you own the database you should have privileges to backup/restore, if hosting facility does not alows for it then you are hosting in the wrong place.

    ok how to disable Referential Integrity

    My first question is why do you want to disable Referential Integrity?

    What you are asking to do is usually considered A Very Bad Thing (yes, I capitalized those words on purpose). At my workplace, anyone who disables RI gets put on the naughty list for the first offense and gets verbally flogged for the second offense. I won't go into what happens on the third offense.

    Next question(s). We've established that you don't have restore permissions. So what exactly is your position in the company? Are you a DBA or a Dev?

    If you're not a DBA, have you contacted the DBA for assistance in getting the data you need?

    just tell me how to do that ,the problem am dev, and we test new hosting service, that allow ccreating database ,and the restore be taken from old backup on their side not externally

  • If this webhosting needs database restores, you really need to contact your DBA team. Obviously they didn't set up the correct permissions and they need to if you want to do end-to-end testing and make sure your new setup is working correctly.

    Importing data won't help you with your test if the goal of your project is to create and restore databases.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 8 posts - 1 through 7 (of 7 total)

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