import/export wizard, using a SQL query data is stored in one table only

  • HI -

    While exporting data from multiple tables using sql query, it is storing all the data in one table only.

    which means if I want data from two or more tables - source and destination table is only one.

    Which will result in incorrect data or no data.

    Can anybody help me here?

    I need all the individual tables to be stored separately.

    Thanks,

    Sanjeev.

  • you can export different tables from SQL server using the import/export wizard, you just need to select multiple tables in the source.

    Or perhaps i am not understanding your issue?

  • Thanks for your time.

    Here you go, this is what i am doing :

    SQL server >> Database >> Tasks >> Export Data >> Choose a data source >> Choose a destination >> Secify table copy of Query.

    Here I select the second option i.e. Write a query to specify data to transfer. Click Next.

    In the next window, you can write query to get the table data, e.g.

    Select * from MasterHistory

    Select * from TransHistory

    Click on next, here it shows you that it will export data in one table named 'query' while i have selected two tables (as above mentioned).

    EXPECTATION::

    I am looking for a solution where I can export multiple tables using SQL query and it should store data in different tables, not in one.

    Thanks,

    Sanjeev.

  • you wont be able to do it that way as you are only specifying one query,

    to do this you have a number of options;

    if your queries are a simple select * from the tables then I would use the table as the source and this will allow multiples.

    If as i suspect you have more complex queries, then you can change these queries into views and this will allow you to select multiple views and export them seprately.

    Also if you want to do anything more advanced then i would use SSIS to create the package as the import/export wizard has some limitations.

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

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