try this
Create Table Lion1
(
Id int identity(1,1)
,Name nvarchar(100)
)
Create Table Lion2
(
Id int identity(1,1)
,Name nvarchar(100)
)
insert into Lion1 values('A1')
insert into Lion1 values('A2')
insert into Lion1 values('A3')
insert into Lion1 values('A4')
insert into Lion1 values('A5')
insert into Lion1 values('A6')
insert into Lion2 values('B1')
insert into Lion2 values('B2')
insert into Lion2 values('B3')
insert into Lion2 values('B4')
insert into Lion2 values('B5')
insert into Lion2 values('B6')
Select * from Lion1
Select * from Lion2
UPDATE
Lion2
SET
Lion2.Name = Lion1.Name --Copy Data From Lion1 to Lion2
FROM
Lion2
INNER JOIN
Lion1
ON
Lion2.ID = Lion1.ID
Select * from Lion1
Select * from Lion2
No comments:
Post a Comment