The insert will look something like this, which shows the values for a single row: INSERT INTO sales1(Order_ID,Region,Country,Item_Type,Sales_Channel,Order_Priority,Order_Date,Ship_Date,Units_Sold,Unit_Price,Unit_Cost,Total_Revenue,Total_Cost,Total_Profit) In SQL Server Management Studio (SSMS), execute the following script: CREATE DATABASE csv_demoĪnd then create the sales table in the dummy database by executing the following script: CREATE TABLE sales1( The first step is to create a dummy database. But, as you’ll soon see, whilst this is fine for a small dataset, if you need to import lots of data, then it will be slow and error-prone. It simply involves creating a table and then performing an insert of the data. The SQL script to import CSV to SQL is quite straightforward. We’re going to be using a set of sample sales data that you can get here. However, the ones here are generally simpler to work through. For example, you can create an SSIS package to do the import, or write a PowerShell script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |