Error with data types while importing flat file to SSMS

teeboy1 1 Reputation point
2021-03-26T04:14:23.127+00:00

I have a .tab file to import to SSMS but when I do successfully, it shows all data types as varchar, which isn't supposed to be.

Any fix for this? 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.
12,607 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,546 questions
{count} votes

2 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,071 Reputation points Microsoft Vendor
    2021-03-26T09:53:06.657+00:00

    Hi @teeboy1 ,

    Did you try to use Import Flat File to SQL Wizard? Refer to Import Flat File to SQL Wizard to get more information.


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.


  2. Tom Phillips 17,716 Reputation points
    2021-03-26T12:55:34.32+00:00

    You will be much happier if you always import data into varchar fields in a "staging" table, and then use insert or update or merge to move the data into the target tables. You will have much more control over the data conversion.