Menu

How do I import CSV data into SQL Server via dbFront?

0 votes

I have about 128 mb of CSV data to import on a quarterly bases.

Would I need to shutdown the server to import that amount of data?

The new data would need to replace the old.

in How To by (3.5k points)
edited by

1 Answer

0 votes
 
Best answer

dbFront has the built-in ability to import data but that is intended for smaller data sets. For more details see: Quick Import

128 mb is a large amount of data and should definitely be imported directly by SQL Server.

There should be no reason to take down the server but you might need to schedule an outage during which you swap out the old data for the new.

The basic steps are:

  1. import the CSV file into a table %WORKINGTABLE%.
  2. validate the data.
  3. Schedule an outage on your website (to let your users know there
    might be a hickup....)
  4. DELETE FROM %yourdestinationtable%
  5. INSERT INTO %yourdestinationtable% SELECT col1, col2 FROM %WORKINGTABLE%;

​​You would need to update the SQL to accommodate the differences in table structures.

The following steps describe how to import your data into a SQL table. They were taken from another site: SQL Server Management Studio CSV Import steps

  • First, create a table in your database into which you will import the CSV file.
  • After the table is created: Log in to your database using SQL Server Management Studio.
  • Right click the database and select Tasks -> Import Data...
  • Click the Next > button.
  • 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.
  • 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.
  • In the Select Source Tables and Views window, you can Edit Mappings before clicking the Next > button.
  • Check Run immediately and click the Next > button.
  • Click the Finish button to run the package.
by (42.3k points)
selected by
Welcome to the dbFront Q&A site, where you can ask questions and receive answers from other members of the community.
 | Minimalist Answer Theme by Digitizor Media
 |
Powered by Question2Answer
...