GithubHelp home page GithubHelp logo

Comments (5)

harmonic7 avatar harmonic7 commented on May 24, 2024 1

Hi @Steve-Mcl , sorry for not getting back to you sooner on this one.

I've checked now and can confirm that I no-longer receive the error relating to the primary key insert. I've also retested the scenario from #35 and the speed doesn't seem to be an issue - I successfully inserted 250,000 rows in about seven seconds using the stored proc with the TVP.

from node-red-contrib-mssql-plus.

Steve-Mcl avatar Steve-Mcl commented on May 24, 2024

Did you include the primary key as a column in the list (should not be in the list if identity is specified)

Are you certain the values being bulk inserted are not in the table?

If it is not either of those, would you be kind enough to provide a sample table create statement and a demo flow & I will look into it?

Thanks for testing.

from node-red-contrib-mssql-plus.

harmonic7 avatar harmonic7 commented on May 24, 2024

No problem,

The primary key is not an identity column, and the table is empty.

The table create statement is:

CREATE TABLE dbo.Temp (
    myKey NVARCHAR(255) PRIMARY KEY,
    name NVARCHAR(255)
)

The flow is:

[{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"abf66d8a.48c46","type":"MSSQL","z":"f6f2187d.f17ca8","mssqlCN":"425f76c7.13a328","name":"","outField":"payload","returnType":0,"throwErrors":1,"query":"dbo.Temp","modeOpt":"","modeOptType":"bulk","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","rows":"rows","rowsType":"msg","params":[{"output":false,"name":"myKey","type":"NVarChar(255)","valueType":"num","value":"0"},{"output":false,"name":"name","type":"NVarChar(255)","valueType":"num","value":"0"}],"x":320,"y":60,"wires":[["6163cb34.235974"]]},{"id":"c0f9e7f3.6e46b","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"rows","v":"[{\"myKey\":\"AAA_Test1\",\"name\":\"AAA_Test1\"},{\"myKey\":\"AAA_Test2\",\"name\":\"AAA_Test2\"}]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":60,"wires":[["abf66d8a.48c46"]]},{"id":"6163cb34.235974","type":"debug","z":"f6f2187d.f17ca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":60,"wires":[]},{"id":"425f76c7.13a328","type":"MSSQL-CN","tdsVersion":"7_4","name":"sqldata sdb","server":"sqldata","port":"1433","encyption":true,"trustServerCertificate":true,"database":"sdb","useUTC":true,"connectTimeout":"15000","requestTimeout":"15000","cancelTimeout":"5000","pool":"5","parseJSON":false,"enableArithAbort":true}]

I actually tried it earlier with much more data to insert (10,000 records) - and aside from the primary key issue, things inserted well.

from node-red-contrib-mssql-plus.

Steve-Mcl avatar Steve-Mcl commented on May 24, 2024

Hi @harmonic7 I have now published a beta.3

https://www.npmjs.com/package/node-red-contrib-mssql-plus/v/0.7.0-beta.3

The error you were seeing was because the tedious driver couldnt infer from the parameter that the field was NOT nullable. Even though the bulk data you were sending did not contain nulls the table column MUST be set as not nullable. Who knew!

I have had to re-jig some code and add even more UI options (bah humbug)

image

anyhow, I would really appreciate you testing out beta.3?

Additional point, as you will remember, this beta version also has the v7 MSSQL (which updates tedious from v6.x --> v9.x) are you also seeing the improved speed? (reference issue #35 )

from node-red-contrib-mssql-plus.

Steve-Mcl avatar Steve-Mcl commented on May 24, 2024

I assume this issue is resolved in beta3?

Closing issue for now.

from node-red-contrib-mssql-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.