MSSQL Server Import wizard

Bill Rago 1 Reputation point
2021-08-10T15:13:15.76+00:00

I am using MSSQLserver import wizard. After clicking the EDIT MAPPINGS option I want to edit the SQL and I select this option. In editing the create table query I would like to add a "where" condition to limit the number of hospitals I want to import data from. I have tried several ways and can't get it to work. Any ideas?
thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,361 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vaibhav Chaudhari 38,686 Reputation points
    2021-08-10T15:26:28.937+00:00

    When you provide source & target details, on the next page you should see below options and you choose "Write a query.." and provide select query with where clause so that the result data will flow to your target table

    121978-image.png

    ----------

    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    1 person found this answer helpful.
    0 comments No comments

  2. CathyJi-MSFT 21,131 Reputation points Microsoft Vendor
    2021-08-11T02:49:19.42+00:00

    Hi @Bill Rago ,

    From your description, please choose Write a query to specify the data to transfer option during the process.

    Write a query to specify the data to transfer
    Select this option if you want to filter or sort the source data before you copy it to the destination.
    When you select Write a query to specify the data to transfer, you can only copy the results of one query to one destination table.

    Copy data from one or more tables or views
    Select this option if you want to copy data from the source without filtering or sorting records.

    Below is a test in my environment.

    122173-screenshot-2021-08-11-102928.jpg
    122163-screenshot-2021-08-11-103715.jpg
    122118-screenshot-2021-08-11-104441.jpg
    122100-screenshot-2021-08-11-104033.jpg
    122120-screenshot-2021-08-11-104603.jpg
    Refer to MS document Specify Table Copy or Query (SQL Server Import and Export Wizard).


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.

    0 comments No comments