Skip to content

Instantly share code, notes, and snippets.

@pykong
Created April 27, 2018 09:57
Show Gist options
  • Save pykong/7d8756e23c7d1a013e7e00cf8af04930 to your computer and use it in GitHub Desktop.
Save pykong/7d8756e23c7d1a013e7e00cf8af04930 to your computer and use it in GitHub Desktop.
  1. First, create a table in your database into which you will import the CSV file. After the table is created:

  2. Log in to your database using SQL Server Management Studio.

  3. Right click the database and select Tasks -> Import Data... Click the Next > button.

  4. For Data Source, select Flat File Source. Then use the Browse button to select the CSV file. Spend some time configuring the data import before clicking the Next > button.

  5. For Destination, select the correct database provider (e.g. for SQL Server 2012, you can use SQL Server Native Client 11.0). Enter the Server name; check Use SQL Server Authentication, enter the User name, Password, and Database before clicking the Next > button.

  6. In the Select Source Tables and Views window, you can Edit Mappings before clicking the Next > button.

  7. Check Run immediately and click the Next > button.

  8. Click the Finish button to run the package.

Works best with creating temporary table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment