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.

"Invalid column type from bcp client for colid" - How to use sql.UniqueIdentifier column type?

See original GitHub issue

Hey there,

i am trying to do a bulk insert with 15-20 columns, one of which is a UniqueIdentifier.

My MSSQL table column is a UniqueIdentifier. I am using the node-uuid module to generate a v4 uuid and am trying to get it persisted (unsuccessfully).

  var table = new sql.Table('mytable'); 


    table.create = true;

    table.columns.add('item_type', sql.VarChar(50), {nullable: false});

    table.columns.add('total_events', sql.Int, {nullable: false});

    table.columns.add('guid', sql.UniqueIdentifier, {nullable: false});

    table.rows.add('aa',5,uuid.v4());

The above code will always throw “Invalid column type from bcp client for colid” Error. What type do i have to use to be able to do the insert?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
akila543commented, Sep 8, 2020

@willmorgan jarekb84 is this issue resolved. i have nullable as true and am getting the same error

2reactions
jarekb84commented, Sep 30, 2016

@aaronwilliams97 Had the same issue and setting the nullable option fixed it for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid column type from bcp client for colid - Stack Overflow
I'm getting the following error message: Invalid column type from bcp client for colid 1. I'm using node-mssql package.
Read more >
bcp error - Invalid column type from bcp client for colid 1
You might be experiencing the following error with bcp when loading text data to SQL Server table;. It is possible to see this...
Read more >
Invalid column type from bcp client for colid xx.
I have an issue with transferring some data from prod to uat, the two tables are identical. I first thought this might have...
Read more >
SQL UNIQUEIDENTIFIER Data Type - Dofactory
This data type is used as primary key alternative to IDENTITY columns. UNIQUEIDENTIFIER is globally unique, whereas IDENTITY is unique within a table....
Read more >
Received an invalid column length from the bcp client for colid ...
To avoid this, try exceeding the data-length of the string datatype in the database table. Hope this helps. Dinesh 3457. score:0. Great piece ......
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