microsoft / mssql-jdbc

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity with SQL Server through the standard JDBC application program interfaces (APIs).
MIT License
1.06k stars 427 forks source link

[QUESTION] Is bulk copy supported on Microsoft Fabric? #2451

Closed hchenatsafe closed 4 months ago

hchenatsafe commented 5 months ago

Question

Hello, when attempting to insert data to a Data Warehouse on Microsoft Fabric via Bulk Copy, the driver returns this exception:

com.microsoft.sqlserver.jdbc.SQLServerException: INSERT is not a supported statement type. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:261) at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:316) at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:137) at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:42) at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:31) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.sendBulkCopyCommand(SQLServerBulkCopy.java:1622) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.doInsertBulk(SQLServerBulkCopy.java:1577) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.access$300(SQLServerBulkCopy.java:67) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy$1InsertBulk.doExecute(SQLServerBulkCopy.java:673) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7748) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4410) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.sendBulkLoadBCP(SQLServerBulkCopy.java:707) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:1670) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:630)

Is Bulk Copy not supported on Microsoft Fabric? We don't encounter this issue on other Data Warehouses on Synapse, like Dedicated SQL Pools. We also don't encounter this issue when using regular INSERTs.

barryw-mssql commented 5 months ago

Hi hchenatsafe,

This issue is unexpected as we believe that bulk copy should work. Having said that we have not tested the driver with Fabric and at this time cannot certify it's use with Fabric. We suspect that there may be some element/configuration in Fabric that is causing this problem. We suggest that you reach out to the Fabric team as they have far more experience with these kinds of issues. We are interested in anything that you might learn.

Thx, Barry

Jeffery-Wasty commented 4 months ago

Hi @hchenatsafe,

We're closing this issue as this is related to Fabric and not the JDBC driver.