i must merge multible database tables in a node js windows service. so i decided to write a method that creates a sql string for this. here is my method: this method and the created sql string works nice, expect in one case. if the value in the source table column is NULL the target will not be updated. here
Tag: sql-insert
How to Insert C# values to MySql?
I want to insert C# winform values to Mysql there are 3 columns name,id are TextBox text and gender is ComboBox value but there is error and error messsage said: MySql.Data.MySqlClient.MySqlException:…
making sure only an existing user in the table can add a record in PostgreSQL
I have something like fb groups, where people can be moderators. If a user wants to add a moderator to a certain group, I’d like to check that first of all he himself is a moderator of this group. …
PostgreSQL duplicate key value violates unique constraint while using on conflict do nothing on insert
Table def: I have a function that inserts new rows into the database: It fails with the index Although running the relevant insert on its own with duplicate values it has no problem with it. I can’t understand what seems to be the the difference between the function and the single statement? This also works without a problem: same error
SQL Server : assistance with INSERT INTO
I have a problem where I need to create new entries in the SpecialOfferProduct table. I am applying my created discount (SpecialOfferID = 20) to all products that have an inventory greater than 1800 but I can’t figure out what I am doing wrong. this is my code. It’s from the AdventureWorks2012 database Thanks Answer did you means it
INSERT value by adding URL and file name
I want to to insert value into my single column with website URL and upload path. But I’m really don’t doing that. Here I have 2 columns into my table. And I want to insert the website URL and upload …
SQL UPSERT QUERY W/ Duplicate Rows Made Unique Based Upon 3 Fields (C# VisStudio)
Background is I’m making a SQL connection that takes a .csv file and imports it into a SQL Server database table. The problem I’m running into is, I’m having trouble with the query syntax because …
Are SQL Server unique constraints “Silent” or do they raise an exception?
I want to prevent inserting duplicate values into my tables. At first, I added code to check if the value already existed in the database, but that seems like a lot of overhead / wasted time if I can prevent it at the DDL level. So I found this and changed one of my tables (as an example) from this:
How to use nextval() to insert a row containing its own ID in a string
I have a table that contains a column with a string containing its own ID. How can I insert a new line using a single SQL statement? I need something like https://www.db-fiddle.com/f/3NwLNBirN7mHKpDk9NyHSy/1 Answer One option is to select the next serial in a subquery first: You could also use a computed column instead would make for cleaner insert code: Gives
MYSQL no duplicate of 2 values
I couldn’t find an answer for this exact question although I am sure the information is on here somewhere. I have a python script that is adding stock data into a database. For each stock database has ~1000 lines where ‘ticker’ is the stock name and ‘time’ is the date(1 for each day). When I run my update script I