Why can't I use the Import Data Wizard (on SSMS) to alter the default schema for new destination tables?

hapless 1 Reputation point
2020-08-22T02:02:35.43+00:00

Hello,

I hope this question is clear. I am still in the process of adding an image of the error message.

I am using the wizard to import a flat file source into my database. I have SQL Server Express 2019.
My goal is to create a table with the [raw] schema instead of the [dbo] schema the wizard default creates for me.

When I come to the stage in the wizard where I can edit mappings, I am able to view and edit the wizard-generated T-SQL query. If I change the bracketed [dbo] to [raw] and then execute the query, I have multiple errors in creating the table, specifically in the pre-execute stage.

19672-capture.png

Why isn't modifying the T-SQL sufficient to change the schema?

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,290 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,597 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Guoxiong 8,201 Reputation points
    2020-08-22T02:51:38.583+00:00

    I think the problem was that after you edited the SQL query, i.e., from [dbo].[Temp] to [raw].[Temp], you have to edit the Destination table list to make sure the name is the same as the one you updated in the SQL query since it does not change automatically.

    0 comments No comments

  2. CathyJi-MSFT 21,121 Reputation points Microsoft Vendor
    2020-08-24T06:40:29.453+00:00

    Hi hapless,

    Did you try to alter the default schema directly in this box as below screenshot? I test this in my environment, it works.
    19760-annotation-2020-08-24-143614.jpg
    Best regards,
    Cathy