September 7, 2019 at 7:40 am
This was removed by the editor as SPAM
September 7, 2019 at 1:07 pm
I can always change a select-insert into a merge. There's never going to be a "WHEN MATCHED". Must try to see if it solves the problem.
Yep
declare @master table(id int identity(1,1), name varchar(10));
declare @master_values table(id int identity(1,1), name varchar(10), value int);
insert @master(name) values ('kim'), ('jack');
insert @master_values(name, value)
select m.name, l.value
from
@master m
join
(values (1, 10), (2, 15 )) as l (id, value) on l.id = m.id;
declare @values table (id int, value int, dt datetime2(2) default(getdate()));
declare @lastupdate table (name varchar(10), value int, dt datetime2(2));
merge
@values as t
using
@master_values as src
on
1=0
when not matched then
insert values(src.id, src.value, getdate())
output
inserted.id, src.name, inserted.value;
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
October 11, 2019 at 12:02 pm
This was removed by the editor as SPAM
October 29, 2019 at 10:28 am
This was removed by the editor as SPAM
November 5, 2019 at 1:30 am
This was removed by the editor as SPAM
November 5, 2019 at 1:31 am
This was removed by the editor as SPAM
November 5, 2019 at 1:38 am
This was removed by the editor as SPAM
November 22, 2019 at 9:00 am
This was removed by the editor as SPAM
December 16, 2019 at 11:14 am
This was removed by the editor as SPAM
December 16, 2019 at 11:18 am
This was removed by the editor as SPAM
December 24, 2019 at 8:41 am
Hello,
Your examples are really apt.
I also face problem in the creation of columns sometimes,
A copy of an existing table can also be created using the CREATE TABLE really easily.
The new table gets the same column definitions and even all columns or specific columns can be selected.
If you create a new table using an existing table, the new table will be filled with the existing values from the old table.
March 5, 2020 at 9:11 am
This was removed by the editor as SPAM
June 2, 2020 at 1:12 am
This was removed by the editor as SPAM
Viewing 13 posts - 16 through 27 (of 27 total)
You must be logged in to reply to this topic. Login to reply