question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Data type float is not supported in bulk copy.

See original GitHub 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 © 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

com.microsoft.sqlserver.jdbc.SQLServerException: Data type float is not supported in bulk copy.

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:226) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.getDestTypeFromSrcType(SQLServerBulkCopy.java:1443) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.createInsertBulkCommand(SQLServerBulkCopy.java:1464) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.sendBulkCopyCommand(SQLServerBulkCopy.java:1611) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.doInsertBulk(SQLServerBulkCopy.java:1553) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.access$200(SQLServerBulkCopy.java:63) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy$1InsertBulk.doExecute(SQLServerBulkCopy.java:705) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.sendBulkLoadBCP(SQLServerBulkCopy.java:733) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:1669) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeResultSet(SQLServerBulkCopy.java:641) at com.microsoft.sqlserver.jdbc.SQLServerBulkCopy.writeToServer(SQLServerBulkCopy.java:579)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
peterbaecommented, Mar 18, 2019

Fixed in #986. Closing issue.

1reaction
cheenamalhotracommented, Mar 1, 2019

Hi @bryanayers

We do reproduce the error now and investigations are in progress. Thanks for the repro code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bulk Load in SQL Server failed to load float values
I'm getting following error while doing that: com.microsoft.sqlserver.jdbc.SQLServerException: Data type float is not supported in bulk copy ...
Read more >
Datatype error in Azure Data factory copy activity - Microsoft Q&A
I am trying to load data using bulk insert method (not polybase) and I am constantly getting below error for one of the...
Read more >
OracleBulkCopy ODP.net "ORA-16550: truncated result" when ...
I'm encountering error "ORA-16550: truncated result" when writing double's to a FLOAT(126) column, using OracleBulkCopy.
Read more >
Data Types | SQL Server Syntax and Examples - Count
FLOAT values are truncated when converted into any type of INTEGER. Avoid using FLOAT equality checks (=), inequality (<>) checks etc, rounding of...
Read more >
Numeric types - Amazon Redshift
Describes the rules for working with numeric types supported by Amazon ... Numeric data types include integers, decimals, and floating-point numbers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found