Hi SUJAYS,
I have create the sample .If you have any doubt revert me
Below is the sample.
SQL
DECLARE @TABLE1 TABLE
(
BillId INT
,Prodid INT
,Saleper INT
,Dates DATETIME
)
INSERT INTO @TABLE1 VALUES(1,1001, 5,'11-2-2017')
INSERT INTO @TABLE1 VALUES(2,1002, 4,'11-1-2017')
INSERT INTO @TABLE1 VALUES(3,1003, 7,'11-3-2017')
DECLARE @TABLE2 TABLE
(
Itemid INT
,Taxper INT
,hsncode VARCHAR(100)
,Taxperid INT
)
INSERT INTO @TABLE2 VALUES(1001,4, 'sdsd3434',1)
INSERT INTO @TABLE2 VALUES(1002,12, 'fdfd34343',2)
UPDATE t2
SET Taxper=5
FROM @TABLE2 t2
INNER JOIN @TABLE1 t1
ON t2.Itemid = t1.Prodid
SELECT * FROM @TABLE2
Output
Itemid |
Taxper |
hsncode |
Taxperid |
1001 |
5 |
sdsd3434 |
1 |
1002 |
5 |
fdfd34343 |
2 |