Questions tagged [merge]
A SQL statement that can conditionally insert, update, or delete target rows.
175 questions
3 votes
1 answer
105 views
MERGE causes unique constraint violation when source contains key multiple times
Given two tables counter and cnt_source defined like this: create temporary table counter (key bigint, count bigint); create unique index counter_key_uniq on counter (key); create temporary table ...
0 votes
1 answer
448 views
Do I need a `HOLDLOCK` on a `MERGE` that's not sourcing from another table?
I need to know whether the following pattern requires me to use HOLDLOCK in a very highly concurrent environment. Particularly note that the source is not another table. It's basically parameters that ...
0 votes
1 answer
87 views
Two SQL databases combined [closed]
I have an accounting firm client that recently acquired another firm. They both use the IDENTICAL software products that utilize a SQL server, so the table structure should be identical or nearly ...
1 vote
1 answer
163 views
What are the idiomatic approaches to cross-server upserts?
This is a very common problem, faced by virtually every DBA who has to responsibilities to both application and BI teams. Consider the following: You have two T-SQL servers, Production and Reporting. ...
0 votes
1 answer
39 views
Optimize import data from one table into another
Edited on mustaccio request. I have simple table: -- DROP TABLE IF EXISTS public.objects; CREATE TABLE IF NOT EXISTS public.objects ( id integer NOT NULL DEFAULT nextval('objects_id_seq'::...
0 votes
1 answer
224 views
MongoDB: How to merge a BSON backup with a '.wt' back-up
I am trying to merge a mongodb deployment with a previous back-up due to some processing that took place on the data. I have downloaded and extracted the backup to recover the '.wt' files and can set ...
2 votes
0 answers
25 views
Merge Replication in SQL2019 database is restored to new server NOT keeping_replication
Merge Replication in SQL2019 database is restored to new server NOT keeping_replication but in restored database we find MSmerge_cont_% system views. The last part of the system view name appears to ...
0 votes
1 answer
113 views
SQL Server Merge Replication bulk delete leaves subscriber databases large
We have SQL Server 2017 merge replication set up with three subscribers (running SQL Server 2017 Express). We need to clear data from the server database occasionally to reduce the database size at ...