Click here to Skip to main content
15,891,372 members
Articles / Database Development / SQL Server
Article

To generate insert statement for user defined tables available in SQL Server 2000, through easy to use wizard.

Rate me:
Please Sign up or sign in to vote.
2.50/5 (9 votes)
23 Jun 20061 min read 78.1K   646   27   23
It will generate insert statement as per the tables selected by the user, and it also take cares of Identity inserts in the table.

Sample Image - GenerateSQLInsertScripts.gif
First Step

Image 2
Second Step

Image 3
Third Step

Introduction

By default SQL Server provides a facility to generate script for Database Objects. But their is no option offered by SQL Server to generate insert statements for the existing data in the tables. I faced this problem several times while creating application installer, I always had to ask someone to create insert statement for the master data or some data mandatory for application installation.

To overcome problem of manually generating Insert statements for SQL Server, I finally decided to build a wizard based utility that allows user to genrate insert scripts.

Using this tool

This tool is developed in C#, so we need to make sure we have Microsoft .Net Framework 1.1 installed on the system. It can generate sql scripts in 3 simple steps:

1. Enter connection detail for your SQL Server.

2. Select the tables, and organize them as per thier relation in the database i.e. Master should come first and then dependent tables to avoid refrential integrity error statements

3. Click on "Copy" button to copy generated statement to clipboard

Points of Interest

This component is as free as .Net Framework library.

History

1. Revised verson uploaded on 25-Jun-06  - To display truncate statements and handle UniqueIdentifier datatypes
2. Initial version added on 15-May'06

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionPlease check this tool with more features Pin
Rishikesh_Singh23-Feb-12 3:57
Rishikesh_Singh23-Feb-12 3:57 
Questionnot generating insert statement Pin
IMQ13-Apr-09 3:54
IMQ13-Apr-09 3:54 
AnswerRe: not generating insert statement Pin
Vivek Singh - IN13-Apr-09 6:39
Vivek Singh - IN13-Apr-09 6:39 
GeneralRe: not generating insert statement Pin
IMQ13-Apr-09 8:54
IMQ13-Apr-09 8:54 
GeneralIt gives an unhandled exception Pin
jbmixed19-Feb-08 0:12
jbmixed19-Feb-08 0:12 
GeneralGreat Tool Pin
Russell Aboobacker31-Oct-07 2:43
Russell Aboobacker31-Oct-07 2:43 
Thanks Very Much for the Great tool.
It helped us a lot..And will help in future..
Keep the Good Work.

Russell Aboobacker
First Ameican Corporation
Questionharinov60 requires assistance Pin
Sean Ewington24-Oct-07 4:22
staffSean Ewington24-Oct-07 4:22 
AnswerRe: harinov60 requires assistance Pin
Vivek Singh - IN25-Oct-07 0:26
Vivek Singh - IN25-Oct-07 0:26 
GeneralSQL Scripter Pin
Member 35689139-Jan-07 4:18
Member 35689139-Jan-07 4:18 
GeneralSQL Server 2005 Pin
Ant6313-Dec-06 1:50
Ant6313-Dec-06 1:50 
GeneralRe: SQL Server 2005 Pin
Vivek Singh - IN13-Dec-06 20:12
Vivek Singh - IN13-Dec-06 20:12 
GeneralMissing quotes for uniqueidentifier column Pin
jtseung20-Jun-06 16:49
jtseung20-Jun-06 16:49 
GeneralRe: Missing quotes for uniqueidentifier column Pin
Vivek Singh - IN23-Jun-06 19:56
Vivek Singh - IN23-Jun-06 19:56 
GeneralDecimal problem Pin
AnT5120-Jun-06 3:00
AnT5120-Jun-06 3:00 
GeneralRe: Decimal problem Pin
Vivek Singh - IN23-Jun-06 20:01
Vivek Singh - IN23-Jun-06 20:01 
GeneralRe: Decimal problem Pin
AnT5129-Jun-06 23:34
AnT5129-Jun-06 23:34 
GeneralRe: Decimal problem Pin
Vivek Singh - IN29-Jun-06 23:56
Vivek Singh - IN29-Jun-06 23:56 
GeneralLarge databases, and another tool Pin
Sire4045-Jun-06 4:27
Sire4045-Jun-06 4:27 
GeneralRe: Large databases, and another tool Pin
Vivek Singh - IN5-Jun-06 17:18
Vivek Singh - IN5-Jun-06 17:18 
GeneralSource Code Missing Pin
devnet24715-May-06 3:10
devnet24715-May-06 3:10 
GeneralRe: Source Code Missing Pin
Vivek Singh - IN15-May-06 16:44
Vivek Singh - IN15-May-06 16:44 
GeneralRe: Source Code Missing Pin
Pankaj bothara jain4-Apr-07 21:29
Pankaj bothara jain4-Apr-07 21:29 
GeneralRe: Source Code Missing Pin
Vivek Singh - IN9-Apr-07 5:41
Vivek Singh - IN9-Apr-07 5:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.