Uploading data frames to Microsoft SQL Server
We now have two different data frames saved as comma separated value (CSV) files from GitHub and we wish to upload them to our database in Microsoft SQL Server.
Importing DiscountCodebyWeek
The two files are:
DiscountCodebyWeek.csv
CountryRegionBikes.csv
The first step is to log in to SQL Server using Management Studio and right-click on the AdventureWorks2014
database. The next step is to click on Tasks and then on Import Data.
Set your data source to be a Flat File Source and browse to select the source DiscountCodebyWeek.csv
.
When choosing your data source, select the Advanced tab and rename the first column to Index
, as seen in the following screenshot:
Additionally, we can rename both "WeekinYear"
as well as "DiscountCode"
to WeekInYear
and DiscountCode
by selecting each one and removing the quotes. We also want to change the data type of DiscountCode
from string [DT_STR]
to numeric [DT_NUMERIC]
to confirm that the database will treat DiscountCode...