Dependencies: SQL Server, Visual Studio
How to run this project:
- Pull git repository
- Open solution for Roster-Challenge
- Open Package Manager Console in visual studio ( View > Other Windows > Package Manager Console )
- Run the following commands in the package manager console to create a Roster database: update-database
- Run the following SQL against your SQL Server Roster database to import your JSON file (update the script to your local filepath)
Declare @JSON varchar(max)
SELECT @JSON=BulkColumn
FROM OPENROWSET (BULK 'YOUR FILE PATH TO Roster.JSON', SINGLE_CLOB) import
SELECT @JSON=[value] FROM OPENJSON (@JSON)
INSERT INTO Artists
SELECT *, 0 FROM OPENJSON (@JSON)
WITH
(
[artist] nvarchar(MAX),
[rate] float,
[streams] int
)
- Run your solution in visual studio