i have two tables like ....
table1
sno name id
1 raju 245
2 vamshi 386
table2
sno name id
1 kiran 9876
2 praveen 7654
i want merge table2 date in table1
o/p like
table1
sno name id
1 raju 245
2 vamshi 386
3 kiran 9876
4 praveen 7654
Loading

JAYRAMRank #7,836 · 233 reputationPosted Mar 10, 2014, 7:27 PM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 10, 2014, 8:25 PM EDT
hi,
try...
Create table #table1
(sno int,
name varchar(20),
id int)
Create table #table2
(sno int,
name varchar(20),
id int)
insert into #table1 values(1,'raju',245),
(2,'vamshi',386)
insert into #table2 values(1,'kiran',9876),
(2,'praveen',7654)
declare @max int
select @max = MAX(sno) from #table1
Insert into #table1
select @max + sno, name,id from #table2
hope this will help you.
sudipta sanyalRank #1,945 · 753 reputationPosted Apr 28, 2014, 7:45 PM EDT