-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Data type float is not supported in bulk copy. #961
Comments
Hi @pkgajulapalli, thanks for contacting us. I just tried a quick bulk copy operation (from one connection, using the same SQL Server) that bulk copies data from one table to another (both tables having the same schema, with only one float column) using the 7.0.0.jre8 driver, and it worked for me. Could you provide the table schema from both data sources, and perhaps the connection string as well? Thanks. |
Hi @peterbae , I've run into the same issue, SQL Server 2017, Win 10 client, mssql-jdbc-7.0.0.jre8:
Full source to reproduce below, just create the table beforehand and assign the appropriate values to the variables used in the connection string.
|
Hi @pkgajulapalli, did you find a workaround for this? Hi @peterbae & @cheenamalhotra, can I provide any more info to move this out of "Waiting for Customer"? Thanks in advance! -Bryan |
Hi @bryanayers We do reproduce the error now and investigations are in progress. Thanks for the repro code. |
Hi @bryanayers, I had to cast the float values to double in the query explicitly and load it to the destination table. And that solution worked for me. |
Fixed in #986. Closing issue. |
Driver version
7.0.0.jre8
SQL Server version
Microsoft SQL Server 2016 (SP2-CU3) (KB4458871) - 13.0.5216.0 (X64)
Sep 13 2018 22:16:01
Copyright (c) Microsoft Corporation
Client Operating System
Mac OS
JAVA/JVM version
java version "1.8.0_101"
Problem description
I have to transfer data from one database server to a SQL Server. I'm using SQLServerBulkCopy to do that:
// connection1 is with the source system and
// connection2 is with the destination SQL Server
Statement statement = connnection1.createStatement();
`ResultSet resultSet = statement.executeQuery("select * from db.table");`
SQLServerBulkCopy bulkCopy = new SQLServerBulkCopy(connection2);
bulkCopy.setDestinationTableName("tableName");
bulkCopy.writeToServer(resultSet);
JDBC trace logs
The text was updated successfully, but these errors were encountered: