Importing the National Provider Database, Part I

Hello, I'm Jacob. I perform technology and strategy consulting, including data analytics and machine learning. I blog about various projects I'm working on. If this topic is interesting or relevant to your organization let's talk - hello at jacob dot vi

Each practicing doctor in America is issued a unique identification number, their NPI, which they must use for various purposes, but especially for billing Medicare. The Centers for Medicare and Medicaid Services, releases this dataset monthly as the National Plan and Provider Enumeration System (NPPES) (Unfortunately the direct download link on that site appears to be broken at the moment). I am currently importing the NPI data set into a SQL Server database to support Total Cost of Care analysis work I am currently performing for a community cancer practice.

The data comes as a single 6+GB CSV file, which appears to be a concatenation of multiple database tables. First we'll import the flat file, then we'll look at splitting it into multiple tables. Depending on the database you are using there already exist a number of scripts for importing this table, such as:

I am using SQL Server, so will be basing my import on the discussion in that thread, however will solve the problem in a different way. Here is the CREATE TABLE script I am using:

CREATE TABLE [dbo].[NPPES_Import](
	[NPI] [nvarchar](10) NULL,
	[Entity Type Code] [nvarchar](1) NULL,
	[Replacement NPI] [nvarchar](10) NULL,
	[Employer Identification Number (EIN)] [nvarchar](9) NULL,
	[Provider Organization Name (Legal Business Name)] [nvarchar](70) NULL,
	[Provider Last Name (Legal Name)] [nvarchar](50) NULL,
	[Provider First Name] [nvarchar](50) NULL,
	[Provider Middle Name] [nvarchar](50) NULL,
	[Provider Name Prefix Text] [nvarchar](5) NULL,
	[Provider Name Suffix Text] [nvarchar](5) NULL,
	[Provider Credential Text] [nvarchar](50) NULL,
	[Provider Other Organization Name] [nvarchar](70) NULL,
	[Provider Other Organization Name Type Code] [nvarchar](1) NULL,
	[Provider Other Last Name] [nvarchar](50) NULL,
	[Provider Other First Name] [nvarchar](50) NULL,
	[Provider Other Middle Name] [nvarchar](50) NULL,
	[Provider Other Name Prefix Text] [nvarchar](5) NULL,
	[Provider Other Name Suffix Text] [nvarchar](5) NULL,
	[Provider Other Credential Text] [nvarchar](50) NULL,
	[Provider Other Last Name Type Code] [nvarchar](1) NULL,
	[Provider First Line Business Mailing Address] [nvarchar](256) NULL,
	[Provider Second Line Business Mailing Address] [nvarchar](256) NULL,
	[Provider Business Mailing Address City Name] [nvarchar](50) NULL,
	[Provider Business Mailing Address State Name] [nvarchar](50) NULL,
	[Provider Business Mailing Address Postal Code] [nvarchar](50) NULL,
	[Provider Business Mailing Address Country Code (If outside U S )] [nvarchar](2) NULL,
	[Provider Business Mailing Address Telephone Number] [nvarchar](50) NULL,
	[Provider Business Mailing Address Fax Number] [nvarchar](50) NULL,
	[Provider First Line Business Practice Location Address] [nvarchar](256) NULL,
	[Provider Second Line Business Practice Location Address] [nvarchar](256) NULL,
	[Provider Business Practice Location Address City Name] [nvarchar](50) NULL,
	[Provider Business Practice Location Address State Name] [nvarchar](50) NULL,
	[Provider Business Practice Location Address Postal Code] [nvarchar](50) NULL,
	[Provider Business Practice Location Address Country Code (If outside U S )] [nvarchar](2) NULL,
	[Provider Business Practice Location Address Telephone Number] [nvarchar](50) NULL,
	[Provider Business Practice Location Address Fax Number] [nvarchar](50) NULL,
	[Provider Enumeration Date] [date] NULL,
	[Last Update Date] [date] NULL,
	[NPI Deactivation Reason Code] [nvarchar](2) NULL,
	[NPI Deactivation Date] [date] NULL,
	[NPI Reactivation Date] [date] NULL,
	[Provider Gender Code] [nvarchar](1) NULL,
	[Authorized Official Last Name] [nvarchar](50) NULL,
	[Authorized Official First Name] [nvarchar](50) NULL,
	[Authorized Official Middle Name] [nvarchar](50) NULL,
	[Authorized Official Title or Position] [nvarchar](50) NULL,
	[Authorized Official Telephone Number] [nvarchar](50) NULL,
	[Healthcare Provider Taxonomy Code_1] [nvarchar](50) NULL,
	[Provider License Number_1] [nvarchar](50) NULL,
	[Provider License Number State Code_1] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_1] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_2] [nvarchar](50) NULL,
	[Provider License Number_2] [nvarchar](50) NULL,
	[Provider License Number State Code_2] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_2] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_3] [nvarchar](50) NULL,
	[Provider License Number_3] [nvarchar](50) NULL,
	[Provider License Number State Code_3] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_3] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_4] [nvarchar](50) NULL,
	[Provider License Number_4] [nvarchar](50) NULL,
	[Provider License Number State Code_4] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_4] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_5] [nvarchar](50) NULL,
	[Provider License Number_5] [nvarchar](50) NULL,
	[Provider License Number State Code_5] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_5] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_6] [nvarchar](50) NULL,
	[Provider License Number_6] [nvarchar](50) NULL,
	[Provider License Number State Code_6] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_6] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_7] [nvarchar](50) NULL,
	[Provider License Number_7] [nvarchar](50) NULL,
	[Provider License Number State Code_7] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_7] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_8] [nvarchar](50) NULL,
	[Provider License Number_8] [nvarchar](50) NULL,
	[Provider License Number State Code_8] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_8] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_9] [nvarchar](50) NULL,
	[Provider License Number_9] [nvarchar](50) NULL,
	[Provider License Number State Code_9] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_9] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_10] [nvarchar](50) NULL,
	[Provider License Number_10] [nvarchar](50) NULL,
	[Provider License Number State Code_10] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_10] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_11] [nvarchar](50) NULL,
	[Provider License Number_11] [nvarchar](50) NULL,
	[Provider License Number State Code_11] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_11] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_12] [nvarchar](50) NULL,
	[Provider License Number_12] [nvarchar](50) NULL,
	[Provider License Number State Code_12] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_12] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_13] [nvarchar](50) NULL,
	[Provider License Number_13] [nvarchar](50) NULL,
	[Provider License Number State Code_13] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_13] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_14] [nvarchar](50) NULL,
	[Provider License Number_14] [nvarchar](50) NULL,
	[Provider License Number State Code_14] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_14] [nvarchar](1) NULL,
	[Healthcare Provider Taxonomy Code_15] [nvarchar](50) NULL,
	[Provider License Number_15] [nvarchar](50) NULL,
	[Provider License Number State Code_15] [nvarchar](2) NULL,
	[Healthcare Provider Primary Taxonomy Switch_15] [nvarchar](1) NULL,
	[Other Provider Identifier_1] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_1] [nvarchar](2) NULL,
	[Other Provider Identifier State_1] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_1] [nvarchar](80) NULL,
	[Other Provider Identifier_2] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_2] [nvarchar](2) NULL,
	[Other Provider Identifier State_2] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_2] [nvarchar](80) NULL,
	[Other Provider Identifier_3] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_3] [nvarchar](2) NULL,
	[Other Provider Identifier State_3] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_3] [nvarchar](80) NULL,
	[Other Provider Identifier_4] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_4] [nvarchar](2) NULL,
	[Other Provider Identifier State_4] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_4] [nvarchar](80) NULL,
	[Other Provider Identifier_5] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_5] [nvarchar](2) NULL,
	[Other Provider Identifier State_5] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_5] [nvarchar](80) NULL,
	[Other Provider Identifier_6] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_6] [nvarchar](2) NULL,
	[Other Provider Identifier State_6] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_6] [nvarchar](80) NULL,
	[Other Provider Identifier_7] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_7] [nvarchar](2) NULL,
	[Other Provider Identifier State_7] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_7] [nvarchar](80) NULL,
	[Other Provider Identifier_8] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_8] [nvarchar](2) NULL,
	[Other Provider Identifier State_8] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_8] [nvarchar](80) NULL,
	[Other Provider Identifier_9] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_9] [nvarchar](2) NULL,
	[Other Provider Identifier State_9] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_9] [nvarchar](80) NULL,
	[Other Provider Identifier_10] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_10] [nvarchar](2) NULL,
	[Other Provider Identifier State_10] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_10] [nvarchar](80) NULL,
	[Other Provider Identifier_11] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_11] [nvarchar](2) NULL,
	[Other Provider Identifier State_11] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_11] [nvarchar](80) NULL,
	[Other Provider Identifier_12] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_12] [nvarchar](2) NULL,
	[Other Provider Identifier State_12] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_12] [nvarchar](80) NULL,
	[Other Provider Identifier_13] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_13] [nvarchar](2) NULL,
	[Other Provider Identifier State_13] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_13] [nvarchar](80) NULL,
	[Other Provider Identifier_14] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_14] [nvarchar](2) NULL,
	[Other Provider Identifier State_14] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_14] [nvarchar](80) NULL,
	[Other Provider Identifier_15] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_15] [nvarchar](2) NULL,
	[Other Provider Identifier State_15] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_15] [nvarchar](80) NULL,
	[Other Provider Identifier_16] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_16] [nvarchar](2) NULL,
	[Other Provider Identifier State_16] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_16] [nvarchar](80) NULL,
	[Other Provider Identifier_17] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_17] [nvarchar](2) NULL,
	[Other Provider Identifier State_17] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_17] [nvarchar](80) NULL,
	[Other Provider Identifier_18] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_18] [nvarchar](2) NULL,
	[Other Provider Identifier State_18] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_18] [nvarchar](80) NULL,
	[Other Provider Identifier_19] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_19] [nvarchar](2) NULL,
	[Other Provider Identifier State_19] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_19] [nvarchar](80) NULL,
	[Other Provider Identifier_20] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_20] [nvarchar](2) NULL,
	[Other Provider Identifier State_20] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_20] [nvarchar](80) NULL,
	[Other Provider Identifier_21] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_21] [nvarchar](2) NULL,
	[Other Provider Identifier State_21] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_21] [nvarchar](80) NULL,
	[Other Provider Identifier_22] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_22] [nvarchar](2) NULL,
	[Other Provider Identifier State_22] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_22] [nvarchar](80) NULL,
	[Other Provider Identifier_23] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_23] [nvarchar](2) NULL,
	[Other Provider Identifier State_23] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_23] [nvarchar](80) NULL,
	[Other Provider Identifier_24] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_24] [nvarchar](2) NULL,
	[Other Provider Identifier State_24] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_24] [nvarchar](80) NULL,
	[Other Provider Identifier_25] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_25] [nvarchar](2) NULL,
	[Other Provider Identifier State_25] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_25] [nvarchar](80) NULL,
	[Other Provider Identifier_26] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_26] [nvarchar](2) NULL,
	[Other Provider Identifier State_26] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_26] [nvarchar](80) NULL,
	[Other Provider Identifier_27] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_27] [nvarchar](2) NULL,
	[Other Provider Identifier State_27] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_27] [nvarchar](80) NULL,
	[Other Provider Identifier_28] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_28] [nvarchar](2) NULL,
	[Other Provider Identifier State_28] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_28] [nvarchar](80) NULL,
	[Other Provider Identifier_29] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_29] [nvarchar](2) NULL,
	[Other Provider Identifier State_29] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_29] [nvarchar](80) NULL,
	[Other Provider Identifier_30] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_30] [nvarchar](2) NULL,
	[Other Provider Identifier State_30] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_30] [nvarchar](80) NULL,
	[Other Provider Identifier_31] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_31] [nvarchar](2) NULL,
	[Other Provider Identifier State_31] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_31] [nvarchar](80) NULL,
	[Other Provider Identifier_32] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_32] [nvarchar](2) NULL,
	[Other Provider Identifier State_32] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_32] [nvarchar](80) NULL,
	[Other Provider Identifier_33] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_33] [nvarchar](2) NULL,
	[Other Provider Identifier State_33] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_33] [nvarchar](80) NULL,
	[Other Provider Identifier_34] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_34] [nvarchar](2) NULL,
	[Other Provider Identifier State_34] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_34] [nvarchar](80) NULL,
	[Other Provider Identifier_35] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_35] [nvarchar](2) NULL,
	[Other Provider Identifier State_35] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_35] [nvarchar](80) NULL,
	[Other Provider Identifier_36] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_36] [nvarchar](2) NULL,
	[Other Provider Identifier State_36] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_36] [nvarchar](80) NULL,
	[Other Provider Identifier_37] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_37] [nvarchar](2) NULL,
	[Other Provider Identifier State_37] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_37] [nvarchar](80) NULL,
	[Other Provider Identifier_38] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_38] [nvarchar](2) NULL,
	[Other Provider Identifier State_38] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_38] [nvarchar](80) NULL,
	[Other Provider Identifier_39] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_39] [nvarchar](2) NULL,
	[Other Provider Identifier State_39] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_39] [nvarchar](80) NULL,
	[Other Provider Identifier_40] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_40] [nvarchar](2) NULL,
	[Other Provider Identifier State_40] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_40] [nvarchar](80) NULL,
	[Other Provider Identifier_41] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_41] [nvarchar](2) NULL,
	[Other Provider Identifier State_41] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_41] [nvarchar](80) NULL,
	[Other Provider Identifier_42] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_42] [nvarchar](2) NULL,
	[Other Provider Identifier State_42] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_42] [nvarchar](80) NULL,
	[Other Provider Identifier_43] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_43] [nvarchar](2) NULL,
	[Other Provider Identifier State_43] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_43] [nvarchar](80) NULL,
	[Other Provider Identifier_44] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_44] [nvarchar](2) NULL,
	[Other Provider Identifier State_44] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_44] [nvarchar](80) NULL,
	[Other Provider Identifier_45] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_45] [nvarchar](2) NULL,
	[Other Provider Identifier State_45] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_45] [nvarchar](80) NULL,
	[Other Provider Identifier_46] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_46] [nvarchar](2) NULL,
	[Other Provider Identifier State_46] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_46] [nvarchar](80) NULL,
	[Other Provider Identifier_47] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_47] [nvarchar](2) NULL,
	[Other Provider Identifier State_47] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_47] [nvarchar](80) NULL,
	[Other Provider Identifier_48] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_48] [nvarchar](2) NULL,
	[Other Provider Identifier State_48] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_48] [nvarchar](80) NULL,
	[Other Provider Identifier_49] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_49] [nvarchar](2) NULL,
	[Other Provider Identifier State_49] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_49] [nvarchar](80) NULL,
	[Other Provider Identifier_50] [nvarchar](50) NULL,
	[Other Provider Identifier Type Code_50] [nvarchar](2) NULL,
	[Other Provider Identifier State_50] [nvarchar](2) NULL,
	[Other Provider Identifier Issuer_50] [nvarchar](80) NULL,
	[Is Sole Proprietor] [nvarchar](1) NULL,
	[Is Organization Subpart] [nvarchar](1) NULL,
	[Parent Organization LBN] [nvarchar](70) NULL,
	[Parent Organization TIN] [nvarchar](50) NULL,
	[Authorized Official Name Prefix Text] [nvarchar](5) NULL,
	[Authorized Official Name Suffix Text] [nvarchar](5) NULL,
	[Authorized Official Credential Text] [nvarchar](50) NULL,
	[Healthcare Provider Taxonomy Group_1] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_2] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_3] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_4] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_5] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_6] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_7] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_8] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_9] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_10] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_11] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_12] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_13] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_14] [nvarchar](80) NULL,
	[Healthcare Provider Taxonomy Group_15] [nvarchar](80) NULL
) ON [PRIMARY]

I have set the NPI and enumerated columns to be the proper length as specified in the data dictionary and provided additional length for certain columns. To import the data I am using the built-in SSIS Import Wizard. When importing the flat file using this tool, it is critical to spend time on the first screen defining the properties of the CSV file. Be sure to set the text delimiter in order to remove extraneous data that is encoded as "".

SQL Server Import and Export Wizard Screen Shot

Before proceeding to the next screen, choose the Advanced panel on the CSV import screen. Many of the columns are defined with a max length of 50 in the CSV file (this is auto-set by the import wizard). If you import the file without changing these max lengths you will get the truncation errors mentioned in the above StackOverflow post, regardless if you table itself has been properly defined. Any column that CMS specifies as having over 50 characters, must be updated here with sufficient length.

SQL Server Import and Export Wizard Screen Shot

Once this is done you can proceed as usual through the import screens.

To split this data into multiple tables, see Importing the National Provider Database Part II

Show Comments