Click here to Skip to main content
Licence 
First Posted 14 May 2006
Views 55,817
Bookmarked 27 times

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

By | 23 Jun 2006 | Article
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


Second Step


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

About the Author

Vivek Singh - IN

Web Developer

India India

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionPlease check this tool with more features PinmemberRishikesh_Singh3:57 23 Feb '12  
Questionnot generating insert statement PinmemberIMQ3:54 13 Apr '09  
AnswerRe: not generating insert statement PinmemberVivek Singh - IN6:39 13 Apr '09  
GeneralRe: not generating insert statement PinmemberIMQ8:54 13 Apr '09  
GeneralIt gives an unhandled exception Pinmemberjbmixed0:12 19 Feb '08  
GeneralGreat Tool PinmemberRussell Aboobacker2:43 31 Oct '07  
Questionharinov60 requires assistance PinadminSean Ewington4:22 24 Oct '07  
AnswerRe: harinov60 requires assistance PinmemberVivek Singh - IN0:26 25 Oct '07  
GeneralSQL Scripter PinmemberMember #35689134:18 9 Jan '07  
GeneralSQL Server 2005 PinmemberAnt631:50 13 Dec '06  
GeneralRe: SQL Server 2005 PinmemberVivek Singh - IN20:12 13 Dec '06  
GeneralMissing quotes for uniqueidentifier column Pinmemberjtseung16:49 20 Jun '06  
GeneralRe: Missing quotes for uniqueidentifier column PinmemberVivek Singh - IN19:56 23 Jun '06  
GeneralDecimal problem PinmemberAnT513:00 20 Jun '06  
GeneralRe: Decimal problem PinmemberVivek Singh - IN20:01 23 Jun '06  
GeneralRe: Decimal problem PinmemberAnT5123:34 29 Jun '06  
GeneralRe: Decimal problem PinmemberVivek Singh - IN23:56 29 Jun '06  
GeneralLarge databases, and another tool PinmemberSire4044:27 5 Jun '06  
GeneralRe: Large databases, and another tool PinmemberVivek Singh - IN17:18 5 Jun '06  
GeneralSource Code Missing Pinmemberdevnet2473:10 15 May '06  
GeneralRe: Source Code Missing PinmemberVivek Singh - IN16:44 15 May '06  
GeneralRe: Source Code Missing PinmemberPankaj bothara jain21:29 4 Apr '07  
GeneralRe: Source Code Missing PinmemberVivek Singh - IN5:41 9 Apr '07  

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

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 24 Jun 2006
Article Copyright 2006 by Vivek Singh - IN
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid