【发布时间】:2015-08-12 11:58:49
【问题描述】:
我有两张表,即 ExcelData 和 PlanProfile 。我想要的是,当我遍历 ExcelData 表的每一行时,逻辑将在另一个表 PlanProfile 的属性字段中插入 column_names,但我不想遍历每一列,对于某些列应该可以正常插入第二张桌子。
ExcelData table:
Id PId PType CId CNotes CLegal
1 101 test 201 notes testlegal
2 102 test 202 notes testlegal
3 103 test 203 notes testLegal
我在第二张表 PlanProfile 中想要什么;
Id PId PType Attributes Value
1 101 test CId 201
2 101 test CNotes notes
3 101 test CLegal testlegal
4 102 test CId 202
5 102 test CNotes notes
6 102 test CLegal testlegal
----- same goes for 103
【问题讨论】:
标签: sql sql-server database sql-server-2008 sql-server-2012