Several solutions for ms SQL Server to export data into Insert statements

Source: Internet
Author: User

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]

Related Article

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.