How to export particular table list from sql server 2005 DB

  • Hi ,

    There is an  option to export list of tables in sql server. That is export/import wizard.

    Here actual scenario is we do not have access to production system. But we wanted to export  around 250 tables from production DB. we know the list of table names.  And we can not ask customer to use export wizard as  they will have to sit and select 250 tables in an random list, for which customer will not agree also.

    In oracle there is an option while exporting we can mention the tables name in export command.

    Like this is there any other command in sql server to export where i can mention tables name?

    Regards,
    Vaithilingam K

  • Quick question, why not restore the db from a backup and then drop the unwanted tables?
    😎

  • But the challenge is this task needs to be performed without having access to the database. Do you have access to that specific database? Now don't tell that you need to enter into the house which is locked and you do not have key(access).

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • Eirikur Eiriksson - Tuesday, May 23, 2017 2:30 AM

    Quick question, why not restore the db from a backup and then drop the unwanted tables?
    😎

    Dump is very huge we do not have hardware to store the entier dump and remove unwanted tables..

  • free_mascot - Tuesday, May 23, 2017 3:15 AM

    But the challenge is this task needs to be performed without having access to the database. Do you have access to that specific database? Now don't tell that you need to enter into the house which is locked and you do not have key(access).

    HTH

    Let me explain the scenario with respect to oracle.

    we have export command in oracle where in you can specify the tables name  and export it. if we have to export 250 tables out of 700 tables. then we can mentioned 25 tables names in one command . like wise we can create export command and ask customer to just run the command. Then they will be able to share the dumps where in each one have 25 tables data.

    So i will import all the dump one  by one in my local DB.

    Like above  is there any option in sql server?

  • vaithi.saran846 - Tuesday, May 23, 2017 8:41 AM

    Eirikur Eiriksson - Tuesday, May 23, 2017 2:30 AM

    Quick question, why not restore the db from a backup and then drop the unwanted tables?
    😎

    Dump is very huge we do not have hardware to store the entier dump and remove unwanted tables..

    One can restore to an external hard drive, clean up, back up and restore again on the target system, externals are less than $50/TB
    😎
    Just do that on a USB3 😉

  • vaithi.saran846 - Tuesday, May 23, 2017 8:49 AM

    free_mascot - Tuesday, May 23, 2017 3:15 AM

    But the challenge is this task needs to be performed without having access to the database. Do you have access to that specific database? Now don't tell that you need to enter into the house which is locked and you do not have key(access).

    HTH

    Let me explain the scenario with respect to oracle.

    we have export command in oracle where in you can specify the tables name  and export it. if we have to export 250 tables out of 700 tables. then we can mentioned 25 tables names in one command . like wise we can create export command and ask customer to just run the command. Then they will be able to share the dumps where in each one have 25 tables data.

    So i will import all the dump one  by one in my local DB.

    Like above  is there any option in sql server?

    It sounds like what you might want would be bcp in sql server, https://docs.microsoft.com/en-us/sql/tools/bcp-utility

    You wouldn't be able to do it in one command but you should be able to set up a list of 250 export commands for the tables you care about and provide that to your customer, if you give it to them in a batch file or something it should basically be one command to them.  Have them generate the extract and zip up the directory to send to you.

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

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