Use CodeSmith to generate INSERTINTO... SQL statement for SQL Server table data

Source: Internet
Author: User
In the past, I turned to an article about the use of stored procedures to generate a blog that is complicated and prone to errors. csdn. netlee576articledetails3511012 this template is occasionally found in CodeSmith today. This is convenient. The selected node is ScriptTableData. the specific template code of cst will not be pasted. You can see it. In the attribute box, Set

In the past turned an article, is the use of the storage process generated, the method is complex, and easy to error http://blog.csdn.net/lee576/article/details/3511012 today occasionally found that CodeSmith has this template, this is convenient, hehe selected node, ScriptTableData. the specific template code of cst will not be pasted. You can see it. In the attribute box, Set

In the past, an article was written, which was generated using the stored procedure. The method was complex and error-prone.

Http://blog.csdn.net/lee576/article/details/3511012

This template is occasionally found in CodeSmith today, which is convenient.

Selected node, ScriptTableData. cst


The specific template code will not be pasted. You can see it. Select SourceTable In the attribute box.


Click "Generate" on the toolbar to Generate a SQL statement for this table.

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 'color 9', 'j1s ', '123', 81, 6, 40855,861 7, '000000', 49472, '17. 4', 1500253,216 28.1, 225428, '6053a294-8505-4120-BF92-63BCA08948CC 'unionselect' color 9', 'j1s ', '123', 88, 7, 200202 73, '123', 28496,368, 65369, '56. 4', 3630318,491 39.7, 1421461, '6053a294-8505-4120-BF92-63BCA08948CC 'UNION ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.