![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
tblTwo = tblOne.Copy(); |
|
Hi All, Can anybody tell me how to copy one column of a data table to another data table. Example:I have 2 data tables say dt1,dt2. Here,i wanna copy only the 1st column values of dt1 into the 1st column of dt2. Its an urgent work for me.So,anyone of you can give me a solution to this. Regards, Mahalakshmi. |
#3
| |||
| |||
|
|
Hi Mahalakshmi, Does the Copy() method that Christopher Reed suggested in your other thread work for you? tblTwo = tblOne.Copy(); -- Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP cindy_winegarden (AT) msn (DOT) com www.cindywinegarden.com "Balu" <balu (AT) nannacomputers (DOT) com> wrote in message news:OuE1%2324DGHA.740 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi All, Can anybody tell me how to copy one column of a data table to another data table. Example:I have 2 data tables say dt1,dt2. Here,i wanna copy only the 1st column values of dt1 into the 1st column of dt2. Its an urgent work for me.So,anyone of you can give me a solution to this. Regards, Mahalakshmi. |
#4
| |||
| |||
|
|
Hi, Its working fine.But,i wanna copy only one column of a table not the entire data. But,the statement ..... tblTwo=tblOne.Copy() copies the entire data,i.e.,all column values into another table. Can anybody give a solution for it? Regards, Maha. "Cindy Winegarden" <cindy_winegarden (AT) msn (DOT) com> wrote in message news:Ovl72T6DGHA.208 (AT) tk2msftngp13 (DOT) phx.gbl... Hi Mahalakshmi, Does the Copy() method that Christopher Reed suggested in your other thread work for you? tblTwo = tblOne.Copy(); -- Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP cindy_winegarden (AT) msn (DOT) com www.cindywinegarden.com "Balu" <balu (AT) nannacomputers (DOT) com> wrote in message news:OuE1%2324DGHA.740 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi All, Can anybody tell me how to copy one column of a data table to another data table. Example:I have 2 data tables say dt1,dt2. Here,i wanna copy only the 1st column values of dt1 into the 1st column of dt2. Its an urgent work for me.So,anyone of you can give me a solution to this. Regards, Mahalakshmi. |
#5
| |||
| |||
|
|
Hi Balu, Are you saying that you want to add a new column to a table and populate it or populate a column that's already there but is empty? To do that you'll need to use an update statement and connect the record in the source table to the record in the target table via a primary key. It's not as easy as copying/pasting a column in Excel, for example. In a SQL Server script this would be something like: Alter Table Target Add NewColumn Integer Go Update Target Set Target.NewColumn = (Select Source.OldColumn From Source Where Source.PrimaryKey = Target.PrimaryKey) -- Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP cindy_winegarden (AT) msn (DOT) com www.cindywinegarden.com "Balu" <balu (AT) nannacomputers (DOT) com> wrote in message news:eYXluyBEGHA.1676 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Hi, Its working fine.But,i wanna copy only one column of a table not the entire data. But,the statement ..... tblTwo=tblOne.Copy() copies the entire data,i.e.,all column values into another table. Can anybody give a solution for it? Regards, Maha. "Cindy Winegarden" <cindy_winegarden (AT) msn (DOT) com> wrote in message news:Ovl72T6DGHA.208 (AT) tk2msftngp13 (DOT) phx.gbl... Hi Mahalakshmi, Does the Copy() method that Christopher Reed suggested in your other thread work for you? tblTwo = tblOne.Copy(); -- Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP cindy_winegarden (AT) msn (DOT) com www.cindywinegarden.com "Balu" <balu (AT) nannacomputers (DOT) com> wrote in message news:OuE1%2324DGHA.740 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi All, Can anybody tell me how to copy one column of a data table to another data table. Example:I have 2 data tables say dt1,dt2. Here,i wanna copy only the 1st column values of dt1 into the 1st column of dt2. Its an urgent work for me.So,anyone of you can give me a solution to this. Regards, Mahalakshmi. |
#6
| |||
| |||
|
|
... copy a single column of the data table say 'dt1' to a column in another data table say 'dt2'. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |