Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 629
  • Last Modified:

export data dictionary SQL 2005

Experts- I am looking for a way to export a view of all of our tables, columns, and relationships (data dictionary) to excel or visual format. I have a DB called "Test" that is fairly big.  240+ tables.  The developer never created a formal DDL, and I am looking to create one, and be able to print if needed.

If there is a cut and paste script that i can append when i click "new query", that would be great.  If there is any known good freeware, that is great also.  

I attempted to use some freeware and it created 240 individual scripts.  That will not do.  If there is one script to extract the entire schema that would be best.
0
GTAJR
Asked:
GTAJR
  • 3
  • 3
  • 2
2 Solutions
 
wdosanjosCommented:
On SQL Server Management Studio, select your database, right click, and select 'Tasks / Generate Scripts...' from the menu.  On the pop-up window, select 'Script entire database', and press the Next button through all the screens.  This generates a script to create all your the database objects.

This should provide what you need. Please let me know otherwise.
0
 
dbaSQLCommented:
For the 'data dictionary', I suggest trying out the 'Database Diagrams' in SSMS, at yourserver\databases\yourdatabase\Database Diagram

Right click this folder, and choose 'New Database Diagram'.

There are many different ways you can handle it, but in the designer you will add the tables that you want to include.  If a relationship exists, it will be automatically reflected within the diagram.  And you can always edit what SQL gives back to you.... all tables, some tables, just check it out.


And, of course, there is always Visio (which i love).  It has some very nice integration between SQL, that will allow you to extract the ERD (data dictionary) from your database.
http://msdn.microsoft.com/en-us/library/bb267248.aspx
0
 
GTAJRAuthor Commented:
Will the Visio option also have the definition of the table?  For example, if the real table is something like [database].[dbo].[xyz_employee]   - would Visio list the table as i just listed, then next to it it would say Employee so a sales person can look at this with a client and show a much friendlier version.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dbaSQLCommented:
because Visio is a graphical editor, the output is totally customizable.  You can edit it to say whatever you like.
0
 
GTAJRAuthor Commented:
ok thanks. the issue is that i have over 250 tables.  seems like a lot of work and typing. is there a way to automatically have the definition come over with the name of the table without manually typing?  maybe exporting to excel maybe a bit easier to accomplish with what i am looking to do?
0
 
wdosanjosCommented:
Please check the following view.  It should be able to provide what you are looking for:

select * from INFORMATION_SCHEMA.COLUMNS
ORDER BY TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION

More about Information Schema Views on the link below:

http://msdn.microsoft.com/en-us/library/ms186778%28v=SQL.90%29.aspx

I hope this helps.
0
 
dbaSQLCommented:
The first suggestion I gave you was Database Diagrams within SSMS.  See the attached, I just chose 'New Database Diagram' within the hierarchy of AdventureWorks datbase.  I picked a couple of tables that I knew were related, and just hit the add button.  By default, I just got the three tables, in the format that you see in SalesTerritory(Sales) and Customer(Sales), which is just the table name, the primary key is indicated with a little key picture, and the relationships are represented with the little reference key, linking the tables.

Then, I just went up into the 'Table View' menu item.  You will see Standard, Column Names, Keys, Name Only, Custom, and Modify Custom.  I had the SalesTerritoryHistory(Sales) table selected, or highlighted at that time, and I chose 'Modify Custom'.  That is the dialog box you see with 'Column Selection' in the header.  Here, you choose the type of output you want.  I chose three, and you can see the format of that table is slightly different now, in that it contains the datatypes, and whether or not it is nullable.

There was no typing in any of that.  I just selected some tables, and modified the output format that the diagram is produced in, within the Database Diagram options.

I know the Visio add-in actually has similar defaults, used to extract the database object definition from SQL Server.  Unfortunately, I don't have one in front of my right now, to give you a snapshot.


Database Diagram example
0
 
GTAJRAuthor Commented:
both options were very good.  thank you for helping.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now