question

BillRago-4947 avatar image
0 Votes"
BillRago-4947 asked Cathyji-msft commented

MSSQL Server Import wizard

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-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @BillRago-4947,

We have not received a response from you. Did the reply(s) could help you? If the response helped, do "Accept Answer". If it is not, please let us know. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·
VaibhavChaudhari avatar image
1 Vote"
VaibhavChaudhari answered

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


image.png (26.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered Cathyji-msft edited

Hi @BillRago-4947,

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.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.