sql server - Copy SQL column from one to another maintaining ID -
i looking copy sql long binary data "photo" column "id_photo_c" column. both columns in separate tables. got query show need, unfortunately cannot copy & paste outputs "results pane" of mssql.
i cannot copy entire table 1 another, new database has more rows (including duplicates).
http://i.imgur.com/tmrpmh2.png
here code:
select [grouptables].[dbo].[visitorsadvanced].[recordnumber], [ grouptables].[dbo].[visitorsadvanced].[photo], [sugarcrm].[dbo].[contacts_cstm].[xxx_id_number_c], [sugarcrm].[dbo].[contacts_cstm].[id_photo_c] [grouptables].[dbo].[visitorsadvanced], sugarcrm].[dbo].[contacts_cstm] [grouptables].[dbo].[visitorsadvanced].[recordnumber] = [sugarcrm].[dbo].[contacts_cstm].[xxx_id_number_c];
it seems such simple task (would take 2 clicks in excel) - can't seem work.
this isn't duplicate question. i've seen similar questions on here, none of describe how copy data 1 column another.
thank you.
unless i'm missing here, seems simple update statement need:
update [sugarcrm].[dbo].[contacts_cstm] set [id_photo_c] = [sugarcrm].[dbo].[contacts_cstm].[xxx_id_number_c] [grouptables].[dbo].[visitorsadvanced] inner join [sugarcrm].[dbo].[contacts_cstm] on [grouptables].[dbo].[visitorsadvanced].[recordnumber] = [sugarcrm].[dbo].[contacts_cstm].[xxx_id_number_c];
Comments
Post a Comment