Comments (5)
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.
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.
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.
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)
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.
I assume this issue is resolved in beta3?
Closing issue for now.
from node-red-contrib-mssql-plus.
Related Issues (20)
- Parse mustache feature toggle Big Problem HOT 2
- Crash on Amazon Ubuntu HOT 1
- Feature request: Allow variable server IP and Passwords HOT 3
- Feature request: automatic retry on error
- Additional Authentication Methods for Azure SQL HOT 3
- Bulk Insert random insertion on the table
- Instance Name HOT 2
- Multiple queries doesn't show multiple record set
- Does not install with nodejs 20 (@azure/msal-node issue) HOT 7
- SQL Server 2022 HOT 1
- Bulk insert does not work. HOT 11
- I would need "ApplicationIntent=ReadOnly" in the SQL connection string HOT 3
- Environment variables do not appear to be working ? HOT 1
- Support for Node.js 20 HOT 2
- bigint being returned as a string HOT 1
- error: cannot read property 'on' of undefined HOT 3
- Node red crashed due to an sql error
- Version 0.12.1 suddenly becomes dependent on @azure/core-rest-pipeline Version 1.13.0 which breaks on latest NodeRED HOT 3
- Uncaught Exception while stopping flows (during deploy) HOT 1
- Expected minimum version of Node (>=18) should be reflected in package.json (>=12). HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-contrib-mssql-plus.