/*Bulk update
query*/
create table
Table1
(
ID int
identity(1,1),
vIsbn varchar(20),
dcPrice decimal(18,2)
)
create table
Table2
(
ID int
identity(1,1),
vIsbn varchar(20),
dcPrice decimal(18,2)
)
/*Here create
two tables, we update Table1's dcPrice column from Table 2 Using Bulk update*/
insert into
Table1(vIsbn,dcPrice)
values('9087657654312',0.00)
insert into
Table1(vIsbn,dcPrice)
values('9989876765454',0.00)
insert into
Table2(vIsbn,dcPrice)
values('9087657654312',10.20)
insert into
Table2(vIsbn,dcPrice)
values('9989876765454',20.10)
select *
from Table1
/*here bulk
update Query*/
UPDATE Tbl
SET dcPrice=Tbl2.dcPrice
FROM Table1 Tbl
JOIN Table2 AS Tbl2
ON Tbl.vIsbn=Tbl2.vIsbn
select *
from Table1
drop table
Table1
drop table Table2
This comment has been removed by the author.
ReplyDeletehelpful article
DeleteNice blog..
ReplyDeletegood blog..
DeleteThanks
Deletealmost good blog...
Delete