Bulk insert .json data into SSMS(Sql server management studio)
11:14 17 Jul 2018

I have SSMS & I like to upload a .json file into it from my local directory.

  1. I created a table through 'create table' query specifying columns & respective data types.[The tablename is Loan_test]
  2. Now I can see the table structure with all the column names.
  3. Then I copied the code from this link [https://learn.microsoft.com/en-us/sql/relational-databases/json/import-json-documents-into-sql-server?view=sql-server-2017]

I used ;

SELECT BulkColumn
 INTO dbo.Loan_test 
 FROM OPENROWSET (BULK 'C:\Users\Hindol\Downloads\Loan.json', SINGLE_CLOB) as j;

Where Loan.json is the json file I wish to load there with data. But I am getting the error

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "C:\Users\Hindol\Downloads\Loan.json" could not be opened. Operating system error code 5(Access is denied.).

As far as I know there is no security restriction which is causing the denial. I opened the .json file with notepad & it's opening with ease. So why I am getting this message is not clear to me, also I could not insert the data under the specified columns.

Please let me know how can I solve it & bulk import .json data in SSMS. Thanks in advance!

sql ssms bulk-load