title: Adjusting the buffer size for a query in SQL Server 2016
body: <p>I have a JSON file with over a million entries (originally MongoDB documents), which is to be imported into an SQL Server table using the OPENROWSET BULK() command in SQL Server. The query works perfectly fine for small JSON files, but for files of larger sizes, it exhibits the following error:</p>
  
  <p>JSON text is not properly formatted. Unexpected character is found at position 0.</p>
  
  <p>The unexpected character's value comes out to be different for different JSON files. My JSON file has the data stored in the form of a JSON Array. The file size is around 300 MB.</p>
  
  <p>I believe this issue is being faced as, during the execution of the query, only partial contents of the file are being loaded to the buffer, due to which, the JSON text seems improperly formatted to the SQL Server.</p>
  
  <p>Hence, my concern now is to adjust the buffer size for the query execution such that the whole contents of the file are loaded to the buffer memory at once.</p>