Copy data from a table to another one has different structure
I have two tables with different structure:
TableSource: intId(not null), txtSummary, strDetail
TableDesc: guidId(not null), guidFK(not null), Name, Detail
I want to migrate data from two fields of tableSource(txtSummary, strDetail) to two fields of tableDesc(Name, Detai开发者_运维问答l).
guidId is auto generation and guidFK should be assigned to a fixed value.
I'v tried writing some t-sql code lines but not success. Could anyone help me?
Something like:
INSERT into TableDesc (Name, Detail)
SELECT txtSummary, strDetail
FROM TableSource
should work, if the other fields are auto-generated on insert like you said. Which database is this using?
精彩评论