您好,欢迎访问一九零五行业门户网

利用CodeSmith 把SqlServer表数据生成INSERT INTO ... 的 SQL

过去转过一篇文章,是利用存储过程生成,手法又复杂,又容易出错 http://blog.csdn.net/lee576/article/details/3511012 今天偶尔发现codesmith下有这个模板,这下方便了,呵呵 选中下图的结点,scripttabledata.cst 具体的模板代码就不贴了,都看得到,在属性框里把
过去转过一篇文章,是利用存储过程生成,手法又复杂,又容易出错
http://blog.csdn.net/lee576/article/details/3511012
今天偶尔发现codesmith下有这个模板,这下方便了,呵呵
选中下图的结点,scripttabledata.cst
具体的模板代码就不贴了,都看得到,在属性框里把sourcetable选上
点工具栏的generate,生成了一个该表的一窜sql
set identity_insert [dbo].[analogydata1] oninsert into [dbo].[analogydata1] ( [block], [layercode], [producedate], [oilwells], [waterwells], [produceoil], [producewater], [ycy], [waterflooding], [producegas], [hsl], [totaloil], [totalgas], [totalwater], [anareservoirid]) select '彩9', 'j1s', '199707', 81, 6, 40855, 8617, '49472', 14047, 450.3, '17.4', 1500253, 21628.1, 225428, '6053a294-8505-4120-bf92-63bca08948cc' union select '彩9', 'j1s', '200202', 88, 7, 28496, 36873, '65369', 23286, 347.9, '56.4', 3630318, 49139.7, 1421461, '6053a294-8505-4120-bf92-63bca08948cc' union ......
其它类似信息

推荐信息