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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted May 27, 2014, 6:40 AM
Assuming there's a one to one correspondence between the rows in table1 and table2. you can then copy the data with:
Farhan ShariffPosted May 27, 2014, 6:48 AM
Thank you for all the replies .... I will try all the methods
Jignesh TrivediPosted May 27, 2014, 6:42 AM
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
Saikiran GstPosted May 27, 2014, 6:22 AM
Jignesh TrivediPosted May 27, 2014, 6:21 AM
what is relationship between these tables?
you want to perform operation from SQL or C# code?
sudipta sanyalPosted May 27, 2014, 6:18 AM