Category "sql-insert"

PostgreSQL duplicate key value violates unique constraint while using on conflict do nothing on insert

Table def: CREATE SEQUENCE IF NOT EXISTS lazy_product_stock_id_seq; CREATE TABLE "public"."lazy_product_stock" ( "id" int4 NOT NULL DEFAULT nextval('lazy_pr

Inserting Data to SQL Server from a Python Dataframe Quickly

I have been trying to insert data from a dataframe in Python to a table already created in SQL Server. The data frame has 90K rows and wanted the best possible

SQLite string search in rows then insert string into new rows with values of the same row last column

I want to provide a query to my database that will search if a string exists in Column2(site_id) then put that string in a new table with the value of its befor

Undo insert query in SQL Server

I ran an insert query on a table in SQL Server by mistake and 100 rows got inserted. I want to undo it but I do not have rollback.

Update on Duplicate key with two columns to check mysql

I am trying to get my head around the 'On Duplicate Key' mysql statement. I have the following table: id (primary key autoincr) / server id (INT) / member id (I

Error: 'duplicate key value violates unique constraint' even when checking with 'where not in'

I get the error: 'duplicate key value violates unique constraint' even when checking if the primary key is already in the table in which I want to insert. I ha

Oracle SQL Trigger: After Update, Insert Rows into Another Table

I am trying to write a trigger on one table that is triggered when the quantity in stock = 0. It will then add a row to another table with the product_id and st

SQL Server : MERGE causing cannot insert the value NULL into column

I am doing a MERGE in SQL Server using the following code MERGE INTO DW_Datawarehouse.[dbo].[DWF_WAREHOUSE] with (HOLDLOCK) AS target USING #DataSource AS Sourc

Using CASE statement to INSERT values into multiple columns in SQLite

I'm trying to use INSERT statement to add values to a few columns in a new table depending on the value of a column in another table. I'm writing in SQLite. I w

Inserting aggregates into big table is too slow

I need to run a query as cronjob and it is too slow to perform. It sums a value from a view table (data_time_series) for each pair of aks and ii and inserts a r

Inserting multiple rows in mysql

Is the database query faster if I insert multiple rows at once: like INSERT.... UNION INSERT.... UNION (I need to insert like 2-3000 ro

How to insert, edit, delete image in SQL using vb.net

I can't Search and Edit using this Code. Insert is working. But Insert coding method is not sure (fileContent.ToString). And Search part and Update part is not