Click here to Skip to main content
Licence Ms-PL
First Posted 20 May 2008
Views 20,337
Downloads 237
Bookmarked 39 times

Schema Generator

By dnpro | 3 Jun 2008
Utility to generate schema description from existing SQL Server databases.
1 vote, 9.1%
1
1 vote, 9.1%
2

3
3 votes, 27.3%
4
6 votes, 54.5%
5
4.42/5 - 11 votes
1 removed
μ 4.10, σa 2.41 [?]

Introduction

In this article, I am introducing a small utility developed for the purpose of extracting schema from existing SQL Server databases. The basic idea behind developing this utility is to emit the database schema from an existing SQL Server database. From a developer perspective, it is sometimes very much handy to quickly take a printout of the database structure for creating the UI layout or to specify some validation rules. If the database structure is available in printable format, then it will serve the purpose of robust programming and effective UI layout, because the developer can establish spontaneity between the database structure and the UI elements. So now, let's start exploring the utility in a little depth.

After extracting the binary distribution, you will find the executable SchemaGenerator.exe. Start the utility from SchemaGenerator.exe.

The first screen will be as follows:

Clipboard01n.gif

The screen shown above asks the input for:

  • Server/instance name: This will be server\instance name. If not specified, it will default to (local).
  • Database name: This is a required input and must specify an existing database.
  • Username/Password: Optional, provide in case of non trusted connections.

Now, fill the server/instance name, i.e., (local)\SQLEXPRESS.

Clipboard02n.gif

Click Generate to produce the report in printable format. The report will be rendered in preview, where we can see the generated schema output, then print, if required.

The print preview window outputs the database structure in printable format, and you can review the format and print it.

Clipboard03small.GIF

I hope this will help some needful developer and avoid duplication of efforts.

“Happy computing!”

History

  • Initial revision 1.0 - May 20 2008
  • Uploaded initial revision.

  • Revision 1.1 - June 04 2008
  • Updated for a new feature for using explicit username and password, in non trusted environments (requested by users).

  • Revision 1.2 - June 05 2008
  • Fixed the issue of printing reports from the Print Preview dialog (requested by users).

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

About the Author

dnpro

Software Developer
Freelance Developer
India India

Member
He has done Masters in Software Engineering from UPTU Lucknow, India.. He is having work experience of 3.5+ years as Senior Software Developer with Atlanta(US) based Software Product Development company. He started his career with PASCAL, then moved to C and finally got into VB 5.0 and now enjoys programming into C#. He loves to works on Enterprise software development using ASP.NET, MOSS and SQL Server. Withal he is proficient in Tool development and System Integration. He is advocate of Open source and love to share solutions with open source communities like nHibernate, SubSonic, SourceForge.
 
Award's :
Prize winner in Competition "Best VB.NET article of May 2008"
 
Ashu' Articles :
Click to see my CodeProject Articles
 
Ashu's Blog :
Share a solution | Explore the .NET world
 
Ashu's Favorite :
nHibernate - The best ORM.
nHibernate Contributed Tools
SubSonic - Best Auto generated DAL.
 

Click to send me your wishes :ashufouzdar@.in.com


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
Generalok article PinmemberDonsw8:56 21 Feb '09  
GeneralRe: ok article Pinmemberdnpro20:06 22 Feb '09  
GeneralPrint only one blank page PinmemberEdward1117:43 4 Jun '08  
GeneralRe: Print only one blank page Pinmemberdnpro2:40 5 Jun '08  
GeneralRe: Print only one blank page Pinmemberdnpro4:30 5 Jun '08  
I found the issue in printing the reports. It was related to resetting the line counter variable. I fixed this issue, Now the utility is working fine.
 
Please accept my apologies, for inconvenience being caused to you. Smile | :)
 
dnpro

GeneralRe: Print only one blank page PinmemberEdward11113:40 5 Jun '08  
GeneralRe: Print only one blank page Pinmemberdnpro23:50 5 Jun '08  
QuestionWith 'sa' password? Pinmemberpvatanpour20:59 27 May '08  
AnswerRe: With 'sa' password? Pinmemberdnpro4:30 30 May '08  
AnswerRe: With 'sa' password? Pinmemberdnpro23:18 3 Jun '08  
GeneralAwsome! Pinmemberpvatanpour11:06 5 Jun '08  
GeneralMS Visio PinmemberGautam Sharma23:21 25 May '08  
General[Message Removed] PinmemberMojtaba Vali1:54 25 May '08  
GeneralVery nice, simple and useful for a trusted connection. PinmemberBuddy Stein7:33 20 May '08  
GeneralNeed correction before approve PinmemberAbhijit Jana3:03 20 May '08  
GeneralRe: Need correction before approve Pinmemberashu fouzdar6:41 20 May '08  
GeneralRe: Need correction before approve PinmemberAbhijit Jana20:18 20 May '08  

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
Web01 | 2.5.120210.1 | Last Updated 4 Jun 2008
Article Copyright 2008 by dnpro
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid