A small amount of data is exported to SQL statements, making it easier to use. The SQL Server Import and Export function is used for a large amount of data.
I have used several methods (still using Google to search ......) :
1.Directly use stored procedures
SQL Server 2000 uses the stored procedure to export the insert statement
Http://wangchao-17915566.javaeye.com/blog/175361
This method looks simple and does not require software installation. However, the author did not write code that supports text/ntext.
2.Use Codematic Code Generation Tool
Use the soft Codematic code generation tool, which provides SQL generation functions.
Http://www.maticsoft.com/
Codematic is a free software. The advantage is that a file is generated in batches, but two bugs are found during use:
A. If the content contains single quotes, it will not be converted into two single quotes, so an error may occur (this problem occurs in versions 2.0 of. NET1.1)
B. If there is a blank character in the data (it is estimated that it will be NULL), this column will be omitted and generated in the INSERT statement,
This seemingly intelligent function is not allowed to be NULL in a certain example, but an error occurs when NULL characters are entered.
3. Use MyGeneration
Create Tables and Build inserts from Tables by using Mygeneration Templates (SQL Server )()
Http://hardrock.cnblogs.com/archive/2005/12/16/298386.html
MyGeneration is a free software, and I use 1.3. It is said that it is powerful, but it is not useful for me.
The speed is very fast, and the generated code is not mentioned in Codematic. The generated result is an SQL script file for each table, and the transaction processing code is added,
It seems that the consideration is very thoughtful.
[Q. E.D]