table1
| C#1 | C#2 | C#3 | -- | --- | --- | -- | --- | Split | D_ID |
| C#-- | C#-- |
| C#-- | C#-- | Split | D_ID |
| C#1 | C#2 | C#3 | -- | --- | --- | -- | --- | Split | D_ID |
| C#-- | C#-- |
| C#-- | C#-- | Split | D_ID |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted May 27, 2014, 2:40 AM EDT
Assuming there's a one to one correspondence between the rows in table1 and table2. you can then copy the data with:
sudipta sanyalRank #1,945 · 753 reputationPosted May 27, 2014, 2:18 AM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted May 27, 2014, 2:21 AM EDT
what is relationship between these tables?
you want to perform operation from SQL or C# code?
Saikiran Gst132 reputationPosted May 27, 2014, 2:22 AM EDT
hi Farhan shariff try this it is usefull for you Insert into table1(Split,D_ID) select Split,D_ID from table2;Jignesh TrivediRank #16 · 50.3K reputationPosted May 27, 2014, 2:42 AM EDT
hi,
try
it might help to you
create table #table1
(
c#1 int,
C#2 int,
Split int,
D_ID int
)
create table #table2
(
c#1 int,
C#2 int
)
Insert into #table1 values(1,2,11,12)
Insert into #table1 values(2,2,11,12)
Insert into #table2 values(1,2)
Insert into #table2 values(2,2)
Alter table #table2 Add Split int
Alter table #table2 Add D_ID int
update #table2
set Split = t.Split,D_ID = t.D_ID
from #table1 t where #table2.c#1 = t.c#1 and #table2.C#2 = t.c#2
select * from #table2
Farhan ShariffRank #2,004 · 725 reputationPosted May 27, 2014, 2:48 AM EDT
Thank you for all the replies .... I will try all the methods